| New file |
| | |
| | | { |
| | | "target-org": "vscodeOrg" |
| | | } |
| | |
| | | [{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzlookup/jzlookup.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"name","value":{"type":"string"}},{"type":"property","name":"option","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","value":{"type":"array","value":[]}},{"type":"property","name":"label","value":{"type":"string"}},{"type":"property","name":"placeholder","value":{"type":"string"}},{"type":"method","name":"refreshdata"},{"type":"method","name":"setvalue"},{"type":"method","name":"getvalue"}]},{"type":"track","targets":[{"name":"InputValue","type":"property"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":156,"column":1}},"classMembers":[{"type":"method","name":"connectedCallback","loc":{"start":{"line":6,"column":4},"end":{"line":13,"column":5}}},{"type":"property","name":"time","loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":12}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":17,"column":4},"end":{"line":19,"column":5}}},{"type":"property","name":"name","loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":16}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"option","loc":{"start":{"line":21,"column":4},"end":{"line":21,"column":20}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","loc":{"start":{"line":22,"column":4},"end":{"line":22,"column":23}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"label","loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":19}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"placeholder","loc":{"start":{"line":24,"column":4},"end":{"line":24,"column":25}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"InputValue","loc":{"start":{"line":25,"column":4},"end":{"line":25,"column":27}},"decorator":"track"},{"type":"property","name":"ShowData","loc":{"start":{"line":26,"column":4},"end":{"line":26,"column":17}}},{"type":"property","name":"isShow","loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":19}}},{"type":"method","name":"searchClick","loc":{"start":{"line":29,"column":4},"end":{"line":32,"column":5}}},{"type":"method","name":"onblurFn","loc":{"start":{"line":33,"column":4},"end":{"line":46,"column":5}}},{"type":"method","name":"changeSearchData","loc":{"start":{"line":48,"column":4},"end":{"line":66,"column":5}}},{"type":"property","name":"ifFlag","loc":{"start":{"line":69,"column":4},"end":{"line":69,"column":19}}},{"type":"method","name":"searchchange","loc":{"start":{"line":71,"column":4},"end":{"line":82,"column":5}}},{"type":"property","name":"inputTiem","loc":{"start":{"line":85,"column":4},"end":{"line":85,"column":18}}},{"type":"method","name":"searchchangeRefresh","loc":{"start":{"line":87,"column":4},"end":{"line":103,"column":5}}},{"type":"property","name":"isClick","loc":{"start":{"line":106,"column":4},"end":{"line":106,"column":21}}},{"type":"method","name":"itemclick","loc":{"start":{"line":108,"column":4},"end":{"line":127,"column":5}}},{"type":"method","name":"refreshdata","loc":{"start":{"line":129,"column":4},"end":{"line":144,"column":5}},"decorator":"api"},{"type":"method","name":"setvalue","loc":{"start":{"line":146,"column":4},"end":{"line":148,"column":5}},"decorator":"api"},{"type":"method","name":"getvalue","loc":{"start":{"line":149,"column":4},"end":{"line":151,"column":5}},"decorator":"api"}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2021-09-18T07:36:00.427Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzlookuplightning/jzlookuplightning.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"objectname","value":{"type":"string"}},{"type":"property","name":"fieldname","value":{"type":"string"}},{"type":"method","name":"setvalue"},{"type":"method","name":"getvalue"},{"type":"method","name":"todisabled"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":62,"column":1}},"classMembers":[{"type":"property","name":"selectValue","loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":21}}},{"type":"property","name":"objectname","loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":25}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"fieldname","loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":24}},"decorator":"api","value":{"type":"string"}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":12,"column":4},"end":{"line":16,"column":5}}},{"type":"method","name":"setIntervalFn","loc":{"start":{"line":18,"column":4},"end":{"line":40,"column":5}}},{"type":"method","name":"handleSubmit","loc":{"start":{"line":42,"column":4},"end":{"line":45,"column":5}}},{"type":"method","name":"setvalue","loc":{"start":{"line":47,"column":4},"end":{"line":49,"column":5}},"decorator":"api"},{"type":"method","name":"getvalue","loc":{"start":{"line":50,"column":4},"end":{"line":52,"column":5}},"decorator":"api"},{"type":"method","name":"todisabled","loc":{"start":{"line":54,"column":4},"end":{"line":61,"column":5}},"decorator":"api"}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2021-09-18T07:36:00.385Z"}] |
| | | [{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzlookup/jzlookup.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"name","value":{"type":"string"}},{"type":"property","name":"option","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","value":{"type":"array","value":[]}},{"type":"property","name":"label","value":{"type":"string"}},{"type":"property","name":"placeholder","value":{"type":"string"}},{"type":"method","name":"refreshdata"},{"type":"method","name":"setvalue"},{"type":"method","name":"getvalue"}]},{"type":"track","targets":[{"name":"InputValue","type":"property"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":156,"column":1}},"classMembers":[{"type":"method","name":"connectedCallback","loc":{"start":{"line":6,"column":4},"end":{"line":13,"column":5}}},{"type":"property","name":"time","loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":12}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":17,"column":4},"end":{"line":19,"column":5}}},{"type":"property","name":"name","loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":16}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"option","loc":{"start":{"line":21,"column":4},"end":{"line":21,"column":20}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","loc":{"start":{"line":22,"column":4},"end":{"line":22,"column":23}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"label","loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":19}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"placeholder","loc":{"start":{"line":24,"column":4},"end":{"line":24,"column":25}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"InputValue","loc":{"start":{"line":25,"column":4},"end":{"line":25,"column":27}},"decorator":"track"},{"type":"property","name":"ShowData","loc":{"start":{"line":26,"column":4},"end":{"line":26,"column":17}}},{"type":"property","name":"isShow","loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":19}}},{"type":"method","name":"searchClick","loc":{"start":{"line":29,"column":4},"end":{"line":32,"column":5}}},{"type":"method","name":"onblurFn","loc":{"start":{"line":33,"column":4},"end":{"line":46,"column":5}}},{"type":"method","name":"changeSearchData","loc":{"start":{"line":48,"column":4},"end":{"line":66,"column":5}}},{"type":"property","name":"ifFlag","loc":{"start":{"line":69,"column":4},"end":{"line":69,"column":19}}},{"type":"method","name":"searchchange","loc":{"start":{"line":71,"column":4},"end":{"line":82,"column":5}}},{"type":"property","name":"inputTiem","loc":{"start":{"line":85,"column":4},"end":{"line":85,"column":18}}},{"type":"method","name":"searchchangeRefresh","loc":{"start":{"line":87,"column":4},"end":{"line":103,"column":5}}},{"type":"property","name":"isClick","loc":{"start":{"line":106,"column":4},"end":{"line":106,"column":21}}},{"type":"method","name":"itemclick","loc":{"start":{"line":108,"column":4},"end":{"line":127,"column":5}}},{"type":"method","name":"refreshdata","loc":{"start":{"line":129,"column":4},"end":{"line":144,"column":5}},"decorator":"api"},{"type":"method","name":"setvalue","loc":{"start":{"line":146,"column":4},"end":{"line":148,"column":5}},"decorator":"api"},{"type":"method","name":"getvalue","loc":{"start":{"line":149,"column":4},"end":{"line":151,"column":5}},"decorator":"api"}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.285Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzlookuplightning/jzlookuplightning.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"objectname","value":{"type":"string"}},{"type":"property","name":"fieldname","value":{"type":"string"}},{"type":"method","name":"setvalue"},{"type":"method","name":"getvalue"},{"type":"method","name":"todisabled"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":62,"column":1}},"classMembers":[{"type":"property","name":"selectValue","loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":21}}},{"type":"property","name":"objectname","loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":25}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"fieldname","loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":24}},"decorator":"api","value":{"type":"string"}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":12,"column":4},"end":{"line":16,"column":5}}},{"type":"method","name":"setIntervalFn","loc":{"start":{"line":18,"column":4},"end":{"line":40,"column":5}}},{"type":"method","name":"handleSubmit","loc":{"start":{"line":42,"column":4},"end":{"line":45,"column":5}}},{"type":"method","name":"setvalue","loc":{"start":{"line":47,"column":4},"end":{"line":49,"column":5}},"decorator":"api"},{"type":"method","name":"getvalue","loc":{"start":{"line":50,"column":4},"end":{"line":52,"column":5}},"decorator":"api"},{"type":"method","name":"todisabled","loc":{"start":{"line":54,"column":4},"end":{"line":61,"column":5}},"decorator":"api"}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.209Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzDataTable/jzDataTable.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"name","value":{"type":"unresolved"}},{"type":"property","name":"idkey","value":{"type":"string","value":"Id"}},{"type":"property","name":"miniheight","value":{"type":"string","value":"min-height: 250px"}},{"type":"property","name":"options","value":{"type":"object","value":{}}},{"type":"property","name":"tableData","value":{"type":"array","value":[]}},{"type":"property","name":"tableIsLoding","value":{"type":"boolean","value":false}},{"type":"method","name":"refreshDataTable"}]},{"type":"track","targets":[{"name":"dataTableConfig","type":"property"}]}],"declarationLoc":{"start":{"line":33,"column":0},"end":{"line":132,"column":1}},"classMembers":[{"type":"property","name":"name","loc":{"start":{"line":34,"column":4},"end":{"line":34,"column":14}},"decorator":"api","value":{"type":"unresolved"}},{"type":"property","name":"idkey","loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":22}},"decorator":"api","value":{"type":"string","value":"Id"}},{"type":"property","name":"miniheight","loc":{"start":{"line":36,"column":4},"end":{"line":36,"column":42}},"decorator":"api","value":{"type":"string","value":"min-height: 250px"}},{"type":"property","name":"options","loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":22}},"decorator":"api","value":{"type":"object","value":{}}},{"type":"property","name":"tableData","loc":{"start":{"line":39,"column":4},"end":{"line":39,"column":24}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"tableIsLoding","loc":{"start":{"line":40,"column":4},"end":{"line":40,"column":31}},"decorator":"api","value":{"type":"boolean","value":false}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":42,"column":4},"end":{"line":44,"column":5}}},{"type":"property","name":"dataTableConfig","loc":{"start":{"line":46,"column":4},"end":{"line":46,"column":50}},"decorator":"track"},{"type":"method","name":"initJzDataTable","loc":{"start":{"line":48,"column":4},"end":{"line":54,"column":5}}},{"type":"method","name":"refreshDataTable","loc":{"start":{"line":56,"column":4},"end":{"line":77,"column":5}},"decorator":"api"},{"type":"method","name":"onHandleSort","loc":{"start":{"line":80,"column":4},"end":{"line":92,"column":5}}},{"type":"method","name":"sortBy","loc":{"start":{"line":94,"column":4},"end":{"line":108,"column":5}}},{"type":"property","name":"dataPlus","loc":{"start":{"line":110,"column":4},"end":{"line":112,"column":5}}},{"type":"property","name":"isLoading","loc":{"start":{"line":114,"column":4},"end":{"line":116,"column":5}}},{"type":"method","name":"selecttionPlus","loc":{"start":{"line":118,"column":4},"end":{"line":123,"column":5}}},{"type":"method","name":"handleSave","loc":{"start":{"line":124,"column":4},"end":{"line":130,"column":5}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.341Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzlookupv2/jzlookupv2.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"name","value":{"type":"string"}},{"type":"property","name":"option","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","value":{"type":"array","value":[]}},{"type":"property","name":"label","value":{"type":"string"}},{"type":"property","name":"placeholder","value":{"type":"string"}},{"type":"property","name":"disabled","value":{"type":"boolean","value":false}},{"type":"method","name":"refreshdata"},{"type":"method","name":"setvalue"},{"type":"method","name":"getvalue"},{"type":"method","name":"iszero"}]},{"type":"track","targets":[{"name":"InputValue","type":"property"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":152,"column":1}},"classMembers":[{"type":"method","name":"connectedCallback","loc":{"start":{"line":6,"column":4},"end":{"line":12,"column":5}}},{"type":"method","name":"renderedCallback","loc":{"start":{"line":14,"column":4},"end":{"line":21,"column":5}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":24,"column":4},"end":{"line":26,"column":5}}},{"type":"property","name":"name","loc":{"start":{"line":27,"column":4},"end":{"line":27,"column":16}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"option","loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":20}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","loc":{"start":{"line":29,"column":4},"end":{"line":29,"column":23}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"label","loc":{"start":{"line":30,"column":4},"end":{"line":30,"column":19}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"placeholder","loc":{"start":{"line":31,"column":4},"end":{"line":31,"column":25}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"InputValue","loc":{"start":{"line":32,"column":4},"end":{"line":32,"column":27}},"decorator":"track"},{"type":"property","name":"disabled","loc":{"start":{"line":34,"column":4},"end":{"line":34,"column":25}},"decorator":"api","value":{"type":"boolean","value":false}},{"type":"property","name":"ShowData","loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":17}}},{"type":"property","name":"isShow","loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":19}}},{"type":"method","name":"searchClick","loc":{"start":{"line":38,"column":4},"end":{"line":41,"column":5}}},{"type":"method","name":"onblurFn","loc":{"start":{"line":42,"column":4},"end":{"line":55,"column":5}}},{"type":"method","name":"changeSearchData","loc":{"start":{"line":57,"column":4},"end":{"line":75,"column":5}}},{"type":"property","name":"ifFlag","loc":{"start":{"line":78,"column":4},"end":{"line":78,"column":19}}},{"type":"method","name":"searchchange","loc":{"start":{"line":80,"column":4},"end":{"line":88,"column":5}}},{"type":"property","name":"oldSearchContent","loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":26}}},{"type":"method","name":"searchchangeRefresh","loc":{"start":{"line":91,"column":4},"end":{"line":105,"column":5}}},{"type":"property","name":"isClick","loc":{"start":{"line":108,"column":4},"end":{"line":108,"column":21}}},{"type":"method","name":"itemclick","loc":{"start":{"line":110,"column":4},"end":{"line":128,"column":5}}},{"type":"method","name":"refreshdata","loc":{"start":{"line":130,"column":4},"end":{"line":136,"column":5}},"decorator":"api"},{"type":"method","name":"setvalue","loc":{"start":{"line":138,"column":4},"end":{"line":140,"column":5}},"decorator":"api"},{"type":"method","name":"getvalue","loc":{"start":{"line":141,"column":4},"end":{"line":143,"column":5}},"decorator":"api"},{"type":"property","name":"IsZero","loc":{"start":{"line":145,"column":4},"end":{"line":145,"column":19}}},{"type":"method","name":"iszero","loc":{"start":{"line":147,"column":4},"end":{"line":150,"column":5}},"decorator":"api"}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.290Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzlookupv3/jzlookupv3.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"name","value":{"type":"string"}},{"type":"property","name":"option","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","value":{"type":"array","value":[]}},{"type":"property","name":"label","value":{"type":"string"}},{"type":"property","name":"placeholder","value":{"type":"string"}},{"type":"property","name":"disabled","value":{"type":"boolean","value":false}},{"type":"method","name":"refreshdata"},{"type":"method","name":"setvalue"},{"type":"method","name":"getvalue"},{"type":"method","name":"iszero"},{"type":"method","name":"todisabled"}]},{"type":"track","targets":[{"name":"InputValue","type":"property"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":243,"column":1}},"classMembers":[{"type":"method","name":"connectedCallback","loc":{"start":{"line":6,"column":4},"end":{"line":12,"column":5}}},{"type":"method","name":"renderedCallback","loc":{"start":{"line":14,"column":4},"end":{"line":21,"column":5}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":22}}},{"type":"property","name":"LodingText","loc":{"start":{"line":24,"column":4},"end":{"line":24,"column":19}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":25,"column":4},"end":{"line":29,"column":5}}},{"type":"property","name":"name","loc":{"start":{"line":30,"column":4},"end":{"line":30,"column":16}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"option","loc":{"start":{"line":31,"column":4},"end":{"line":31,"column":20}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"searchdata","loc":{"start":{"line":32,"column":4},"end":{"line":32,"column":23}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"label","loc":{"start":{"line":33,"column":4},"end":{"line":33,"column":19}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"placeholder","loc":{"start":{"line":34,"column":4},"end":{"line":34,"column":25}},"decorator":"api","value":{"type":"string"}},{"type":"property","name":"InputValue","loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":27}},"decorator":"track"},{"type":"property","name":"disabled","loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":25}},"decorator":"api","value":{"type":"boolean","value":false}},{"type":"property","name":"ShowData","loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":17}}},{"type":"property","name":"isShow","loc":{"start":{"line":40,"column":4},"end":{"line":40,"column":19}}},{"type":"method","name":"searchClick","loc":{"start":{"line":41,"column":4},"end":{"line":66,"column":5}}},{"type":"method","name":"onblurFn","loc":{"start":{"line":67,"column":4},"end":{"line":88,"column":5}}},{"type":"property","name":"refreshCount","loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":21}}},{"type":"method","name":"changeSearchData","loc":{"start":{"line":91,"column":4},"end":{"line":129,"column":5}}},{"type":"property","name":"ifFlag","loc":{"start":{"line":132,"column":4},"end":{"line":132,"column":19}}},{"type":"property","name":"searchCount","loc":{"start":{"line":133,"column":4},"end":{"line":133,"column":20}}},{"type":"method","name":"searchchange","loc":{"start":{"line":135,"column":4},"end":{"line":153,"column":5}}},{"type":"property","name":"oldSearchContent","loc":{"start":{"line":155,"column":4},"end":{"line":155,"column":26}}},{"type":"method","name":"searchchangeRefresh","loc":{"start":{"line":156,"column":4},"end":{"line":162,"column":5}}},{"type":"property","name":"isClick","loc":{"start":{"line":165,"column":4},"end":{"line":165,"column":21}}},{"type":"property","name":"itemClickValue","loc":{"start":{"line":166,"column":4},"end":{"line":166,"column":24}}},{"type":"method","name":"itemclick","loc":{"start":{"line":168,"column":4},"end":{"line":198,"column":5}}},{"type":"property","name":"isIconClick","loc":{"start":{"line":199,"column":4},"end":{"line":199,"column":24}}},{"type":"method","name":"iconclick","loc":{"start":{"line":200,"column":4},"end":{"line":208,"column":5}}},{"type":"method","name":"refreshdata","loc":{"start":{"line":210,"column":4},"end":{"line":216,"column":5}},"decorator":"api"},{"type":"method","name":"setvalue","loc":{"start":{"line":218,"column":4},"end":{"line":221,"column":5}},"decorator":"api"},{"type":"method","name":"getvalue","loc":{"start":{"line":222,"column":4},"end":{"line":224,"column":5}},"decorator":"api"},{"type":"property","name":"IsZero","loc":{"start":{"line":226,"column":4},"end":{"line":226,"column":19}}},{"type":"method","name":"iszero","loc":{"start":{"line":228,"column":4},"end":{"line":231,"column":5}},"decorator":"api"},{"type":"property","name":"ondisabledShow","loc":{"start":{"line":233,"column":4},"end":{"line":233,"column":27}}},{"type":"method","name":"todisabled","loc":{"start":{"line":235,"column":4},"end":{"line":242,"column":5}},"decorator":"api"}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.255Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzSearchForm/jzSearchForm.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"name","value":{"type":"unresolved"}},{"type":"property","name":"options","value":{"type":"array","value":[]}}]},{"type":"track","targets":[{"name":"jzSearchFormConfig","type":"property"},{"name":"searchParams","type":"property"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":56,"column":1}},"classMembers":[{"type":"property","name":"name","loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}},"decorator":"api","value":{"type":"unresolved"}},{"type":"property","name":"options","loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":22}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":7,"column":4},"end":{"line":9,"column":5}}},{"type":"property","name":"jzSearchFormConfig","loc":{"start":{"line":27,"column":4},"end":{"line":27,"column":35}},"doc":"*\n * 初始化搜索控件内容\n * [\n * {\n * label: 描述值 必填\n * type: isInput:为true时与Lwc input 中类型一致,其它可为不填\n * name: 控件名称 - 用与搜索中传入后台的参数名 必填\n * value: 控件默认值 \n * isInput: 为true时,显示Lwc中input框 \n * isCombobox: 为true时,显示Lwc中lightning-combobox下拉框\n * options: 为Combobox时,填写下拉框值 [{label: 'New', value: 'new'},...]\n * },\n * ...\n * ]\n * of jzSearchFormConfig","decorator":"track"},{"type":"property","name":"searchParams","loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":29}},"decorator":"track"},{"type":"method","name":"initJzSearchForm","loc":{"start":{"line":30,"column":4},"end":{"line":38,"column":5}}},{"type":"method","name":"handleChange","loc":{"start":{"line":41,"column":4},"end":{"line":44,"column":5}}},{"type":"method","name":"searchData","loc":{"start":{"line":47,"column":4},"end":{"line":54,"column":5}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.336Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/jzTable/jzTable.js","metadata":{"decorators":[{"type":"api","targets":[{"type":"property","name":"selecttitle","value":{"type":"string","value":"已选择"}},{"type":"property","name":"notselecttitle","value":{"type":"string","value":"未选择"}},{"type":"property","name":"isselectedtable","value":{"type":"boolean","value":false}},{"type":"property","name":"optionsdata","value":{"type":"array","value":[]}},{"type":"property","name":"selectdata","value":{"type":"array","value":[]}},{"type":"property","name":"NotData","value":{"type":"array","value":[]}},{"type":"property","name":"notselectdata","value":{"type":"array","value":[]}},{"type":"method","name":"refreshdata"},{"type":"method","name":"getdata"}]},{"type":"track","targets":[{"name":"showData","type":"property"}]}],"declarationLoc":{"start":{"line":3,"column":0},"end":{"line":585,"column":1}},"classMembers":[{"type":"method","name":"connectedCallback","loc":{"start":{"line":6,"column":4},"end":{"line":13,"column":5}}},{"type":"property","name":"selecttitle","loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":29}},"decorator":"api","value":{"type":"string","value":"已选择"}},{"type":"property","name":"notselecttitle","loc":{"start":{"line":17,"column":4},"end":{"line":17,"column":33}},"decorator":"api","value":{"type":"string","value":"未选择"}},{"type":"property","name":"idKey","loc":{"start":{"line":19,"column":4},"end":{"line":19,"column":14}}},{"type":"property","name":"isSelected","loc":{"start":{"line":21,"column":4},"end":{"line":21,"column":23}}},{"type":"method","name":"selectedAllOnClick","loc":{"start":{"line":23,"column":4},"end":{"line":66,"column":5}}},{"type":"property","name":"isselectedtable","loc":{"start":{"line":68,"column":4},"end":{"line":68,"column":33}},"decorator":"api","value":{"type":"boolean","value":false}},{"type":"property","name":"optionsdata","loc":{"start":{"line":72,"column":4},"end":{"line":72,"column":23}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"selectdata","loc":{"start":{"line":74,"column":4},"end":{"line":74,"column":22}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"showData","loc":{"start":{"line":79,"column":4},"end":{"line":79,"column":22}},"decorator":"track"},{"type":"property","name":"clickShow","loc":{"start":{"line":82,"column":4},"end":{"line":82,"column":19}}},{"type":"method","name":"clickShowFn","loc":{"start":{"line":83,"column":4},"end":{"line":86,"column":5}}},{"type":"property","name":"SelectShowArr","loc":{"start":{"line":88,"column":4},"end":{"line":88,"column":21}}},{"type":"method","name":"SelectShowFn","loc":{"start":{"line":89,"column":4},"end":{"line":108,"column":5}}},{"type":"method","name":"OnChreateShowData","loc":{"start":{"line":110,"column":4},"end":{"line":155,"column":5}}},{"type":"property","name":"NotData","loc":{"start":{"line":157,"column":4},"end":{"line":157,"column":20}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"notselectdata","loc":{"start":{"line":160,"column":4},"end":{"line":160,"column":26}},"decorator":"api","value":{"type":"array","value":[]}},{"type":"property","name":"clickShowNotSelect","loc":{"start":{"line":164,"column":4},"end":{"line":164,"column":28}}},{"type":"method","name":"clickShowNotSelectFn","loc":{"start":{"line":165,"column":4},"end":{"line":168,"column":5}}},{"type":"property","name":"NotSelectShowArr","loc":{"start":{"line":171,"column":4},"end":{"line":171,"column":24}}},{"type":"method","name":"NotSelectShowFn","loc":{"start":{"line":172,"column":4},"end":{"line":190,"column":5}}},{"type":"method","name":"CheckNoDataSelected","loc":{"start":{"line":193,"column":4},"end":{"line":201,"column":5}}},{"type":"method","name":"OnChreateNotSelectedData","loc":{"start":{"line":203,"column":4},"end":{"line":249,"column":5}}},{"type":"method","name":"refreshdata","loc":{"start":{"line":253,"column":4},"end":{"line":264,"column":5}},"decorator":"api"},{"type":"method","name":"onselecteChange","loc":{"start":{"line":266,"column":4},"end":{"line":300,"column":5}}},{"type":"method","name":"onChangeFn","loc":{"start":{"line":306,"column":4},"end":{"line":316,"column":5}}},{"type":"property","name":"searchoptions","loc":{"start":{"line":318,"column":4},"end":{"line":318,"column":20}}},{"type":"property","name":"searchdatas","loc":{"start":{"line":319,"column":4},"end":{"line":319,"column":18}}},{"type":"property","name":"queryoptions","loc":{"start":{"line":320,"column":4},"end":{"line":320,"column":19}}},{"type":"property","name":"isQuery","loc":{"start":{"line":321,"column":4},"end":{"line":321,"column":20}}},{"type":"property","name":"queryData","loc":{"start":{"line":322,"column":4},"end":{"line":322,"column":17}}},{"type":"property","name":"SearchOption","loc":{"start":{"line":324,"column":4},"end":{"line":324,"column":22}}},{"type":"property","name":"SearchInitData","loc":{"start":{"line":325,"column":4},"end":{"line":325,"column":24}}},{"type":"property","name":"SearchReturnData","loc":{"start":{"line":326,"column":4},"end":{"line":326,"column":45}}},{"type":"method","name":"onChangeSearchFn","loc":{"start":{"line":329,"column":4},"end":{"line":404,"column":5}}},{"type":"method","name":"onQueryChangeFn","loc":{"start":{"line":406,"column":4},"end":{"line":420,"column":5}}},{"type":"method","name":"querySearchFn","loc":{"start":{"line":422,"column":4},"end":{"line":426,"column":5}}},{"type":"method","name":"searchDataInit","loc":{"start":{"line":428,"column":4},"end":{"line":452,"column":5}}},{"type":"property","name":"OnSearchId","loc":{"start":{"line":455,"column":4},"end":{"line":455,"column":18}}},{"type":"method","name":"showCheckFn","loc":{"start":{"line":456,"column":4},"end":{"line":480,"column":5}}},{"type":"property","name":"TempModelShows","loc":{"start":{"line":482,"column":4},"end":{"line":482,"column":27}}},{"type":"method","name":"OpenShowModelFn","loc":{"start":{"line":483,"column":4},"end":{"line":486,"column":5}}},{"type":"method","name":"ShowModelCloseFn","loc":{"start":{"line":488,"column":4},"end":{"line":491,"column":5}}},{"type":"method","name":"ShowModelSaveFn","loc":{"start":{"line":492,"column":4},"end":{"line":516,"column":5}}},{"type":"method","name":"ChangeDataFn","loc":{"start":{"line":520,"column":4},"end":{"line":567,"column":5}}},{"type":"method","name":"UrlOnClick","loc":{"start":{"line":569,"column":4},"end":{"line":579,"column":5}}},{"type":"method","name":"getdata","loc":{"start":{"line":581,"column":4},"end":{"line":583,"column":5}},"decorator":"api"}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.295Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/maintenanceContract/maintenanceContract.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"paginationRange","type":"property"},{"name":"optionsdata2","type":"property"},{"name":"notselectdata2","type":"property"},{"name":"isselectedtable2","type":"property"}]}],"declarationLoc":{"start":{"line":20,"column":0},"end":{"line":988,"column":1}},"classMembers":[{"type":"property","name":"iftab","loc":{"start":{"line":21,"column":4},"end":{"line":21,"column":16}}},{"type":"property","name":"tab","loc":{"start":{"line":22,"column":4},"end":{"line":22,"column":11}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":24,"column":4},"end":{"line":26,"column":5}}},{"type":"property","name":"Tongzhishow","loc":{"start":{"line":31,"column":0},"end":{"line":31,"column":18}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":20}}},{"type":"property","name":"TongzhiIcon","loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":32}}},{"type":"property","name":"IsLeftStyle","loc":{"start":{"line":34,"column":0},"end":{"line":34,"column":16}}},{"type":"property","name":"BgColorStyle","loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":17}}},{"type":"method","name":"Alert","loc":{"start":{"line":36,"column":0},"end":{"line":55,"column":1}}},{"type":"method","name":"CloseAlert","loc":{"start":{"line":57,"column":0},"end":{"line":66,"column":1}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":70,"column":4},"end":{"line":77,"column":5}}},{"type":"method","name":"moneyFormat","loc":{"start":{"line":80,"column":4},"end":{"line":100,"column":5}}},{"type":"method","name":"InitPorpsData","loc":{"start":{"line":103,"column":4},"end":{"line":108,"column":5}}},{"type":"property","name":"paginationRange","loc":{"start":{"line":112,"column":4},"end":{"line":112,"column":32}},"decorator":"track"},{"type":"property","name":"ifagechange","loc":{"start":{"line":113,"column":4},"end":{"line":113,"column":22}}},{"type":"property","name":"ifagenochange","loc":{"start":{"line":114,"column":4},"end":{"line":114,"column":23}}},{"type":"property","name":"notselectdata2copy","loc":{"start":{"line":115,"column":4},"end":{"line":115,"column":26}}},{"type":"method","name":"getTableData","loc":{"start":{"line":118,"column":4},"end":{"line":220,"column":5}}},{"type":"method","name":"getShiDan","loc":{"start":{"line":222,"column":4},"end":{"line":244,"column":5}}},{"type":"property","name":"optionsdata2","loc":{"start":{"line":253,"column":4},"end":{"line":366,"column":5}},"decorator":"track"},{"type":"property","name":"notselectdata2","loc":{"start":{"line":370,"column":4},"end":{"line":371,"column":5}},"decorator":"track"},{"type":"property","name":"ShiDanList","loc":{"start":{"line":373,"column":4},"end":{"line":373,"column":18}}},{"type":"property","name":"isselectedtable2","loc":{"start":{"line":374,"column":4},"end":{"line":374,"column":36}},"decorator":"track"},{"type":"property","name":"JTYYList","loc":{"start":{"line":377,"column":4},"end":{"line":377,"column":18}}},{"type":"property","name":"QXList","loc":{"start":{"line":379,"column":4},"end":{"line":379,"column":16}}},{"type":"method","name":"initsearchdata2","loc":{"start":{"line":384,"column":4},"end":{"line":389,"column":5}}},{"type":"method","name":"datachange2","loc":{"start":{"line":391,"column":4},"end":{"line":397,"column":5}}},{"type":"method","name":"selectedchange2","loc":{"start":{"line":402,"column":4},"end":{"line":407,"column":5}}},{"type":"property","name":"ManagementCodeSearch","loc":{"start":{"line":412,"column":4},"end":{"line":412,"column":30}}},{"type":"property","name":"NameSearch","loc":{"start":{"line":413,"column":4},"end":{"line":413,"column":20}}},{"type":"property","name":"HospitalSearch","loc":{"start":{"line":414,"column":4},"end":{"line":414,"column":24}}},{"type":"property","name":"OCSMglsSearch","loc":{"start":{"line":415,"column":4},"end":{"line":415,"column":23}}},{"type":"property","name":"ZddSearch","loc":{"start":{"line":416,"column":4},"end":{"line":416,"column":19}}},{"type":"property","name":"RecordTypeSearch","loc":{"start":{"line":417,"column":4},"end":{"line":417,"column":26}}},{"type":"property","name":"RecordTypeSearchList","loc":{"start":{"line":418,"column":4},"end":{"line":422,"column":5}}},{"type":"method","name":"ManagementCodeSearchChange","loc":{"start":{"line":423,"column":4},"end":{"line":427,"column":5}}},{"type":"method","name":"NameSearchChange","loc":{"start":{"line":429,"column":4},"end":{"line":432,"column":5}}},{"type":"method","name":"HospitalSearchChange","loc":{"start":{"line":434,"column":4},"end":{"line":437,"column":5}}},{"type":"method","name":"OCSMglsSearchChange","loc":{"start":{"line":439,"column":4},"end":{"line":442,"column":5}}},{"type":"method","name":"ZddSearchChange","loc":{"start":{"line":443,"column":4},"end":{"line":446,"column":5}}},{"type":"method","name":"RecordTypeSearchChange","loc":{"start":{"line":447,"column":4},"end":{"line":450,"column":5}}},{"type":"method","name":"OnSearch","loc":{"start":{"line":452,"column":4},"end":{"line":455,"column":5}}},{"type":"property","name":"TempData","loc":{"start":{"line":457,"column":4},"end":{"line":466,"column":5}}},{"type":"property","name":"Other_Reasons__cShow","loc":{"start":{"line":467,"column":4},"end":{"line":467,"column":33}}},{"type":"property","name":"Third_Party_Company__cShow","loc":{"start":{"line":468,"column":4},"end":{"line":468,"column":39}}},{"type":"property","name":"Third_Party_Contract_Price__cShow","loc":{"start":{"line":469,"column":4},"end":{"line":469,"column":46}}},{"type":"property","name":"Other__cShow","loc":{"start":{"line":470,"column":4},"end":{"line":470,"column":25}}},{"type":"property","name":"ModelShow","loc":{"start":{"line":473,"column":4},"end":{"line":473,"column":22}}},{"type":"property","name":"ModelIsDistory","loc":{"start":{"line":474,"column":4},"end":{"line":474,"column":27}}},{"type":"method","name":"modalShow1Fn","loc":{"start":{"line":476,"column":4},"end":{"line":524,"column":5}}},{"type":"method","name":"OnDisableModelBar","loc":{"start":{"line":526,"column":4},"end":{"line":567,"column":5}}},{"type":"method","name":"Specific_Reasons__cFn","loc":{"start":{"line":569,"column":4},"end":{"line":580,"column":5}}},{"type":"method","name":"Other_Reasons__cFn","loc":{"start":{"line":582,"column":4},"end":{"line":589,"column":5}}},{"type":"method","name":"To_Where__cFn","loc":{"start":{"line":590,"column":4},"end":{"line":609,"column":5}}},{"type":"method","name":"Third_Party_Company__cFn","loc":{"start":{"line":610,"column":4},"end":{"line":614,"column":5}}},{"type":"method","name":"Third_Party_Contract_Price__cFn","loc":{"start":{"line":615,"column":4},"end":{"line":619,"column":5}}},{"type":"method","name":"Other__cFn","loc":{"start":{"line":620,"column":4},"end":{"line":626,"column":5}}},{"type":"method","name":"SaveClickFn","loc":{"start":{"line":629,"column":4},"end":{"line":655,"column":5}}},{"type":"method","name":"SubmitClickFn","loc":{"start":{"line":657,"column":4},"end":{"line":679,"column":5}}},{"type":"method","name":"ModelCancelFn","loc":{"start":{"line":680,"column":4},"end":{"line":700,"column":5}}},{"type":"property","name":"clickId","loc":{"start":{"line":702,"column":4},"end":{"line":702,"column":16}}},{"type":"property","name":"SaveDataList","loc":{"start":{"line":703,"column":4},"end":{"line":703,"column":21}}},{"type":"method","name":"urlClickFn","loc":{"start":{"line":704,"column":4},"end":{"line":739,"column":5}}},{"type":"method","name":"SaveDataListPushFn","loc":{"start":{"line":741,"column":4},"end":{"line":754,"column":5}}},{"type":"property","name":"JXSModelShow","loc":{"start":{"line":758,"column":4},"end":{"line":758,"column":25}}},{"type":"method","name":"SaveClickJxsFn","loc":{"start":{"line":760,"column":4},"end":{"line":763,"column":5}}},{"type":"method","name":"ModelCancelJxsFn","loc":{"start":{"line":764,"column":4},"end":{"line":767,"column":5}}},{"type":"method","name":"onsearchchange1","loc":{"start":{"line":769,"column":4},"end":{"line":785,"column":6}}},{"type":"property","name":"ZDDModelShow","loc":{"start":{"line":789,"column":0},"end":{"line":789,"column":21}}},{"type":"method","name":"SaveClickZDDFn","loc":{"start":{"line":791,"column":0},"end":{"line":794,"column":1}}},{"type":"method","name":"ModelCancelZDDFn","loc":{"start":{"line":795,"column":0},"end":{"line":798,"column":1}}},{"type":"method","name":"onsearchchangeZDD","loc":{"start":{"line":800,"column":0},"end":{"line":816,"column":2}}},{"type":"property","name":"YYModelShow","loc":{"start":{"line":820,"column":0},"end":{"line":820,"column":20}}},{"type":"method","name":"SaveClickYYFn","loc":{"start":{"line":822,"column":0},"end":{"line":825,"column":1}}},{"type":"method","name":"ModelCancelYYFn","loc":{"start":{"line":826,"column":0},"end":{"line":829,"column":1}}},{"type":"method","name":"onsearchchangeYY","loc":{"start":{"line":831,"column":0},"end":{"line":847,"column":2}}},{"type":"property","name":"KSModelShow","loc":{"start":{"line":851,"column":0},"end":{"line":851,"column":20}}},{"type":"method","name":"SaveClickKSFn","loc":{"start":{"line":853,"column":0},"end":{"line":856,"column":1}}},{"type":"method","name":"ModelCancelKSFn","loc":{"start":{"line":857,"column":0},"end":{"line":860,"column":1}}},{"type":"method","name":"onsearchchangeKS","loc":{"start":{"line":862,"column":0},"end":{"line":878,"column":2}}},{"type":"method","name":"UpdateProsToId","loc":{"start":{"line":881,"column":5},"end":{"line":892,"column":6}}},{"type":"method","name":"OnUpdateDataFn","loc":{"start":{"line":898,"column":4},"end":{"line":925,"column":5}}},{"type":"property","name":"selectOffsetNumber","loc":{"start":{"line":927,"column":4},"end":{"line":927,"column":25}}},{"type":"method","name":"handlePaginationClick","loc":{"start":{"line":928,"column":4},"end":{"line":933,"column":5}}},{"type":"method","name":"changePage","loc":{"start":{"line":935,"column":4},"end":{"line":972,"column":5}}},{"type":"method","name":"lastPage","loc":{"start":{"line":973,"column":4},"end":{"line":979,"column":5}}},{"type":"method","name":"nextPage","loc":{"start":{"line":980,"column":4},"end":{"line":986,"column":5}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.305Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/maintenanceContractNotOpen/maintenanceContractNotOpen.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"paginationRange","type":"property"},{"name":"optionsdata2","type":"property"},{"name":"notselectdata2","type":"property"},{"name":"isselectedtable2","type":"property"}]}],"declarationLoc":{"start":{"line":17,"column":0},"end":{"line":803,"column":1}},"classMembers":[{"type":"property","name":"iftab","loc":{"start":{"line":18,"column":4},"end":{"line":18,"column":16}}},{"type":"property","name":"tab","loc":{"start":{"line":19,"column":4},"end":{"line":19,"column":11}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":21,"column":4},"end":{"line":23,"column":5}}},{"type":"property","name":"Tongzhishow","loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":18}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":20}}},{"type":"property","name":"TongzhiIcon","loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":32}}},{"type":"property","name":"IsLeftStyle","loc":{"start":{"line":31,"column":0},"end":{"line":31,"column":16}}},{"type":"property","name":"BgColorStyle","loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":17}}},{"type":"method","name":"Alert","loc":{"start":{"line":33,"column":0},"end":{"line":52,"column":1}}},{"type":"method","name":"CloseAlert","loc":{"start":{"line":54,"column":0},"end":{"line":63,"column":1}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":67,"column":4},"end":{"line":75,"column":5}}},{"type":"method","name":"InitPorpsData","loc":{"start":{"line":79,"column":4},"end":{"line":84,"column":5}}},{"type":"method","name":"moneyFormat","loc":{"start":{"line":87,"column":4},"end":{"line":107,"column":5}}},{"type":"property","name":"paginationRange","loc":{"start":{"line":110,"column":4},"end":{"line":110,"column":32}},"decorator":"track"},{"type":"property","name":"ifagechange","loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":22}}},{"type":"property","name":"ifagenochange","loc":{"start":{"line":112,"column":4},"end":{"line":112,"column":23}}},{"type":"property","name":"notselectdata2copy","loc":{"start":{"line":113,"column":4},"end":{"line":113,"column":26}}},{"type":"method","name":"getTableData","loc":{"start":{"line":115,"column":4},"end":{"line":212,"column":5}}},{"type":"method","name":"getShiDan","loc":{"start":{"line":214,"column":4},"end":{"line":236,"column":5}}},{"type":"property","name":"optionsdata2","loc":{"start":{"line":245,"column":4},"end":{"line":351,"column":5}},"decorator":"track"},{"type":"property","name":"notselectdata2","loc":{"start":{"line":355,"column":4},"end":{"line":356,"column":5}},"decorator":"track"},{"type":"property","name":"ShiDanList","loc":{"start":{"line":358,"column":4},"end":{"line":358,"column":18}}},{"type":"property","name":"isselectedtable2","loc":{"start":{"line":359,"column":4},"end":{"line":359,"column":36}},"decorator":"track"},{"type":"property","name":"JTYYList","loc":{"start":{"line":362,"column":4},"end":{"line":362,"column":18}}},{"type":"property","name":"QXList","loc":{"start":{"line":364,"column":4},"end":{"line":364,"column":16}}},{"type":"method","name":"initsearchdata2","loc":{"start":{"line":369,"column":4},"end":{"line":374,"column":5}}},{"type":"method","name":"datachange2","loc":{"start":{"line":382,"column":4},"end":{"line":388,"column":5}}},{"type":"property","name":"clickId","loc":{"start":{"line":390,"column":4},"end":{"line":390,"column":16}}},{"type":"property","name":"SaveDataList","loc":{"start":{"line":391,"column":4},"end":{"line":391,"column":21}}},{"type":"method","name":"SaveDataListPushFn","loc":{"start":{"line":392,"column":4},"end":{"line":405,"column":5}}},{"type":"method","name":"UpdateProsToId","loc":{"start":{"line":406,"column":4},"end":{"line":417,"column":5}}},{"type":"method","name":"onChange2","loc":{"start":{"line":420,"column":4},"end":{"line":426,"column":5}}},{"type":"method","name":"selectedchange2","loc":{"start":{"line":429,"column":4},"end":{"line":433,"column":5}}},{"type":"property","name":"ManagementCodeSearch","loc":{"start":{"line":438,"column":4},"end":{"line":438,"column":30}}},{"type":"property","name":"NameSearch","loc":{"start":{"line":439,"column":4},"end":{"line":439,"column":20}}},{"type":"property","name":"HospitalSearch","loc":{"start":{"line":440,"column":4},"end":{"line":440,"column":24}}},{"type":"property","name":"OCSMglsSearch","loc":{"start":{"line":441,"column":4},"end":{"line":441,"column":23}}},{"type":"property","name":"ZddSearch","loc":{"start":{"line":442,"column":4},"end":{"line":442,"column":19}}},{"type":"property","name":"RecordTypeSearch","loc":{"start":{"line":443,"column":4},"end":{"line":443,"column":26}}},{"type":"property","name":"RecordTypeSearchList","loc":{"start":{"line":444,"column":4},"end":{"line":448,"column":5}}},{"type":"method","name":"ManagementCodeSearchChange","loc":{"start":{"line":449,"column":4},"end":{"line":453,"column":5}}},{"type":"method","name":"NameSearchChange","loc":{"start":{"line":455,"column":4},"end":{"line":458,"column":5}}},{"type":"method","name":"HospitalSearchChange","loc":{"start":{"line":460,"column":4},"end":{"line":463,"column":5}}},{"type":"method","name":"OCSMglsSearchChange","loc":{"start":{"line":464,"column":4},"end":{"line":467,"column":5}}},{"type":"method","name":"ZddSearchChange","loc":{"start":{"line":468,"column":4},"end":{"line":471,"column":5}}},{"type":"method","name":"RecordTypeSearchChange","loc":{"start":{"line":472,"column":4},"end":{"line":475,"column":5}}},{"type":"method","name":"OnSearch","loc":{"start":{"line":479,"column":4},"end":{"line":482,"column":5}}},{"type":"property","name":"TempData","loc":{"start":{"line":484,"column":4},"end":{"line":493,"column":5}}},{"type":"property","name":"Other_Reasons__cShow","loc":{"start":{"line":494,"column":4},"end":{"line":494,"column":33}}},{"type":"property","name":"Third_Party_Company__cShow","loc":{"start":{"line":495,"column":4},"end":{"line":495,"column":39}}},{"type":"property","name":"Third_Party_Contract_Price__cShow","loc":{"start":{"line":496,"column":4},"end":{"line":496,"column":46}}},{"type":"property","name":"Other__cShow","loc":{"start":{"line":497,"column":4},"end":{"line":497,"column":25}}},{"type":"property","name":"ModelShow","loc":{"start":{"line":500,"column":4},"end":{"line":500,"column":22}}},{"type":"property","name":"ModelIsDistory","loc":{"start":{"line":501,"column":4},"end":{"line":501,"column":27}}},{"type":"method","name":"urlClickFn","loc":{"start":{"line":502,"column":4},"end":{"line":527,"column":5}}},{"type":"method","name":"OnDisableModelBar","loc":{"start":{"line":529,"column":7},"end":{"line":570,"column":8}}},{"type":"method","name":"Specific_Reasons__cFn","loc":{"start":{"line":572,"column":4},"end":{"line":583,"column":5}}},{"type":"method","name":"Other_Reasons__cFn","loc":{"start":{"line":585,"column":4},"end":{"line":590,"column":5}}},{"type":"method","name":"To_Where__cFn","loc":{"start":{"line":591,"column":4},"end":{"line":610,"column":5}}},{"type":"method","name":"Third_Party_Company__cFn","loc":{"start":{"line":611,"column":4},"end":{"line":615,"column":5}}},{"type":"method","name":"Third_Party_Contract_Price__cFn","loc":{"start":{"line":616,"column":4},"end":{"line":620,"column":5}}},{"type":"method","name":"Other__cFn","loc":{"start":{"line":621,"column":4},"end":{"line":625,"column":5}}},{"type":"method","name":"SaveClickFn","loc":{"start":{"line":628,"column":4},"end":{"line":649,"column":5}}},{"type":"method","name":"SubmitClickFn","loc":{"start":{"line":651,"column":4},"end":{"line":673,"column":5}}},{"type":"method","name":"ModelCancelFn","loc":{"start":{"line":674,"column":4},"end":{"line":693,"column":5}}},{"type":"method","name":"OnUpdateDataFn","loc":{"start":{"line":699,"column":5},"end":{"line":740,"column":6}}},{"type":"property","name":"selectOffsetNumber","loc":{"start":{"line":742,"column":5},"end":{"line":742,"column":26}}},{"type":"method","name":"handlePaginationClick","loc":{"start":{"line":743,"column":5},"end":{"line":748,"column":6}}},{"type":"method","name":"changePage","loc":{"start":{"line":750,"column":5},"end":{"line":787,"column":6}}},{"type":"method","name":"lastPage","loc":{"start":{"line":788,"column":5},"end":{"line":794,"column":6}}},{"type":"method","name":"nextPage","loc":{"start":{"line":795,"column":5},"end":{"line":801,"column":6}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.321Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/productsh/productsh.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"jzDataNotCompleteShow","type":"property"},{"name":"jzDataCompleteShow","type":"property"}]}],"declarationLoc":{"start":{"line":13,"column":0},"end":{"line":460,"column":1}},"classMembers":[{"type":"property","name":"ParamIdStr","loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":20}}},{"type":"method","name":"getQueryVariable","loc":{"start":{"line":16,"column":4},"end":{"line":25,"column":5}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":27,"column":4},"end":{"line":27,"column":22}}},{"type":"property","name":"IsLoadingEnd","loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":24}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":29,"column":4},"end":{"line":32,"column":5}}},{"type":"property","name":"Tongzhishow","loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":22}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":36,"column":4},"end":{"line":36,"column":24}}},{"type":"method","name":"Alert","loc":{"start":{"line":37,"column":4},"end":{"line":44,"column":5}}},{"type":"method","name":"getDataFN","loc":{"start":{"line":47,"column":4},"end":{"line":70,"column":5}}},{"type":"method","name":"getDaysBetween","loc":{"start":{"line":72,"column":4},"end":{"line":79,"column":6}}},{"type":"property","name":"NotCompleteShow","loc":{"start":{"line":85,"column":4},"end":{"line":85,"column":27}}},{"type":"method","name":"NotCompleteShowFn","loc":{"start":{"line":88,"column":4},"end":{"line":91,"column":5}}},{"type":"property","name":"CompleteShow","loc":{"start":{"line":96,"column":4},"end":{"line":96,"column":24}}},{"type":"method","name":"CompleteShowFn","loc":{"start":{"line":99,"column":4},"end":{"line":102,"column":5}}},{"type":"property","name":"DoContentList","loc":{"start":{"line":106,"column":4},"end":{"line":106,"column":22}}},{"type":"property","name":"CheckPurchaseList","loc":{"start":{"line":107,"column":4},"end":{"line":107,"column":25}}},{"type":"property","name":"ActionContent","loc":{"start":{"line":108,"column":4},"end":{"line":108,"column":23}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":109,"column":4},"end":{"line":115,"column":6}}},{"type":"method","name":"onLoadData","loc":{"start":{"line":117,"column":5},"end":{"line":190,"column":6}}},{"type":"property","name":"jzDataNotCompleteShow","loc":{"start":{"line":197,"column":6},"end":{"line":197,"column":40}},"decorator":"track"},{"type":"method","name":"changeSSNR","loc":{"start":{"line":201,"column":7},"end":{"line":245,"column":8}}},{"type":"method","name":"changeJCGRYX","loc":{"start":{"line":246,"column":7},"end":{"line":302,"column":8}}},{"type":"method","name":"changeCLNR","loc":{"start":{"line":303,"column":7},"end":{"line":348,"column":8}}},{"type":"method","name":"changeResult","loc":{"start":{"line":350,"column":7},"end":{"line":385,"column":8}}},{"type":"property","name":"ResultCheckList","loc":{"start":{"line":387,"column":7},"end":{"line":390,"column":8}}},{"type":"method","name":"ChangeResultFn","loc":{"start":{"line":392,"column":7},"end":{"line":408,"column":8}}},{"type":"method","name":"OnSaveClick","loc":{"start":{"line":412,"column":7},"end":{"line":428,"column":8}}},{"type":"property","name":"jzDataCompleteShow","loc":{"start":{"line":435,"column":6},"end":{"line":435,"column":37}},"decorator":"track"},{"type":"method","name":"RevokeChangeFn","loc":{"start":{"line":439,"column":7},"end":{"line":455,"column":8}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.327Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/quoteTrial/quoteTrial.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"Tongzhishow","type":"property"},{"name":"ErrorTongzhishow","type":"property"},{"name":"show","type":"property"},{"name":"pagingShow","type":"property"},{"name":"initSearchForm","type":"property"},{"name":"initDataTable","type":"property"},{"name":"jzData","type":"property"},{"name":"tableIsLoding","type":"property"},{"name":"jzDataDefault","type":"property"},{"name":"tableIsLodingDefault","type":"property"},{"name":"initSearchFormDefalt","type":"property"},{"name":"initDataTableDefault","type":"property"},{"name":"jzDataFixedPrice","type":"property"},{"name":"tableIsLodingFixedPrice","type":"property"},{"name":"initSearchFormFixedPrice","type":"property"},{"name":"initDataTableFixedPrice","type":"property"},{"name":"SelectedFnDataFixedPrice","type":"property"},{"name":"ShowFix","type":"property"},{"name":"initSearchFormFix","type":"property"},{"name":"initDataTableFix","type":"property"},{"name":"jzDataFix","type":"property"},{"name":"tableIsLodingFix","type":"property"},{"name":"jzDataDiscount","type":"property"},{"name":"tableIsLodingDiscount","type":"property"},{"name":"initSearchFormDiscount","type":"property"},{"name":"initDataTableDiscount","type":"property"},{"name":"SelectedFnDataDiscount","type":"property"},{"name":"ShowSpecial","type":"property"},{"name":"TyName","type":"property"},{"name":"initSearchFormSpecial","type":"property"},{"name":"initDataTableSpecial","type":"property"},{"name":"jzDataSpecial","type":"property"},{"name":"tableIsLodingSpecial","type":"property"},{"name":"SelectedFnDataSpecial","type":"property"},{"name":"initSearchFormOtherData","type":"property"},{"name":"initDataTableOtherData","type":"property"},{"name":"jzDataOtherData","type":"property"},{"name":"tableIsLodingOtherData","type":"property"},{"name":"SelectedOtherDataArr","type":"property"},{"name":"ShowCommonly","type":"property"},{"name":"initSearchFormCommonly","type":"property"},{"name":"initDataTableCommonly","type":"property"},{"name":"jzDataCommonly","type":"property"},{"name":"tableIsLodingCommonly","type":"property"},{"name":"jzDataProduct","type":"property"},{"name":"tableIsLodingProduct","type":"property"},{"name":"initDataTableProduct","type":"property"},{"name":"SelectedFnProductData","type":"property"}]}],"declarationLoc":{"start":{"line":82,"column":0},"end":{"line":3017,"column":1}},"classMembers":[{"type":"property","name":"IsLoading","loc":{"start":{"line":84,"column":4},"end":{"line":84,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":86,"column":4},"end":{"line":88,"column":5}}},{"type":"property","name":"label","loc":{"start":{"line":89,"column":4},"end":{"line":92,"column":6}}},{"type":"property","name":"jzDataTableFixedPriceIsShow","loc":{"start":{"line":94,"column":4},"end":{"line":94,"column":40}}},{"type":"property","name":"jzDataTableDiscountIsShow","loc":{"start":{"line":96,"column":4},"end":{"line":96,"column":38}}},{"type":"property","name":"buttonIsShow","loc":{"start":{"line":98,"column":4},"end":{"line":98,"column":25}}},{"type":"property","name":"ParamIdStr","loc":{"start":{"line":101,"column":4},"end":{"line":101,"column":20}}},{"type":"property","name":"ScreenWidth","loc":{"start":{"line":103,"column":4},"end":{"line":103,"column":20}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":104,"column":4},"end":{"line":141,"column":5}}},{"type":"method","name":"ItmeOutFn","loc":{"start":{"line":143,"column":4},"end":{"line":151,"column":5}}},{"type":"property","name":"QuoteData","loc":{"start":{"line":154,"column":4},"end":{"line":154,"column":19}}},{"type":"method","name":"OnLoadQuoteData","loc":{"start":{"line":155,"column":4},"end":{"line":182,"column":5}}},{"type":"property","name":"OnLoadProduct","loc":{"start":{"line":183,"column":4},"end":{"line":183,"column":23}}},{"type":"property","name":"OnLoadSaveProduct","loc":{"start":{"line":184,"column":4},"end":{"line":184,"column":27}}},{"type":"property","name":"OnLoadDiscount","loc":{"start":{"line":185,"column":4},"end":{"line":185,"column":24}}},{"type":"property","name":"OnLoadFixDiscount","loc":{"start":{"line":186,"column":4},"end":{"line":186,"column":27}}},{"type":"property","name":"flagall","loc":{"start":{"line":187,"column":4},"end":{"line":187,"column":20}}},{"type":"method","name":"OnLoadSavesDatas","loc":{"start":{"line":190,"column":4},"end":{"line":262,"column":5}}},{"type":"property","name":"lastQuotation","loc":{"start":{"line":264,"column":4},"end":{"line":264,"column":23}}},{"type":"method","name":"addOffer","loc":{"start":{"line":265,"column":4},"end":{"line":267,"column":5}}},{"type":"property","name":"Complate","loc":{"start":{"line":268,"column":4},"end":{"line":268,"column":21}}},{"type":"method","name":"UpdateSaveDataFixedPriceSelectByID","loc":{"start":{"line":270,"column":4},"end":{"line":301,"column":5}}},{"type":"method","name":"ChangeProductData","loc":{"start":{"line":303,"column":4},"end":{"line":312,"column":5}}},{"type":"method","name":"UpdateSaveDataQuoteLineItemSelectByID","loc":{"start":{"line":314,"column":4},"end":{"line":382,"column":5}}},{"type":"method","name":"SpecialSavesChange","loc":{"start":{"line":385,"column":4},"end":{"line":396,"column":5}}},{"type":"method","name":"GetSearchProductByIdFn","loc":{"start":{"line":399,"column":4},"end":{"line":414,"column":5}}},{"type":"method","name":"countListAndNod","loc":{"start":{"line":417,"column":4},"end":{"line":429,"column":5}}},{"type":"method","name":"CompareData","loc":{"start":{"line":432,"column":4},"end":{"line":516,"column":5}}},{"type":"method","name":"MergeDuplicateSchemes","loc":{"start":{"line":518,"column":4},"end":{"line":556,"column":5}}},{"type":"method","name":"ConsolidationProgramProducts","loc":{"start":{"line":558,"column":4},"end":{"line":561,"column":5}}},{"type":"method","name":"savecount","loc":{"start":{"line":563,"column":4},"end":{"line":574,"column":5}}},{"type":"method","name":"ReplacementUnitPrice","loc":{"start":{"line":576,"column":4},"end":{"line":582,"column":5}}},{"type":"method","name":"ComputeData","loc":{"start":{"line":584,"column":4},"end":{"line":746,"column":5}}},{"type":"method","name":"ComputeDiscount","loc":{"start":{"line":748,"column":4},"end":{"line":825,"column":5}}},{"type":"method","name":"updateCommonlyDiscountLogic","loc":{"start":{"line":827,"column":4},"end":{"line":833,"column":5}}},{"type":"method","name":"ComouteProductDiscount","loc":{"start":{"line":835,"column":4},"end":{"line":846,"column":5}}},{"type":"method","name":"ComputeListPrice","loc":{"start":{"line":849,"column":4},"end":{"line":857,"column":5}}},{"type":"method","name":"delectComputeData","loc":{"start":{"line":859,"column":4},"end":{"line":873,"column":5}}},{"type":"method","name":"ComparePushData","loc":{"start":{"line":875,"column":4},"end":{"line":907,"column":5}}},{"type":"property","name":"CompareFullData","loc":{"start":{"line":910,"column":4},"end":{"line":910,"column":24}}},{"type":"method","name":"AddNums","loc":{"start":{"line":912,"column":4},"end":{"line":933,"column":5}}},{"type":"method","name":"updatesNums","loc":{"start":{"line":935,"column":4},"end":{"line":942,"column":5}}},{"type":"property","name":"ChangeNumZeroTrueData","loc":{"start":{"line":944,"column":4},"end":{"line":944,"column":30}}},{"type":"method","name":"ChangeNumZeroTrue","loc":{"start":{"line":945,"column":4},"end":{"line":955,"column":5}}},{"type":"method","name":"ChangeNumZeroTrueChanges","loc":{"start":{"line":956,"column":4},"end":{"line":960,"column":5}}},{"type":"method","name":"DeleteChangesFn","loc":{"start":{"line":962,"column":4},"end":{"line":1062,"column":5}}},{"type":"method","name":"DeleteIsChangesFnSingle","loc":{"start":{"line":1065,"column":4},"end":{"line":1133,"column":5}}},{"type":"method","name":"DeleteIsChangelogic","loc":{"start":{"line":1135,"column":4},"end":{"line":1202,"column":5}}},{"type":"property","name":"Tongzhishow","loc":{"start":{"line":1204,"column":4},"end":{"line":1204,"column":31}},"decorator":"track"},{"type":"property","name":"ErrorTongzhishow","loc":{"start":{"line":1205,"column":4},"end":{"line":1205,"column":36}},"decorator":"track"},{"type":"property","name":"ShowErrorContent","loc":{"start":{"line":1206,"column":4},"end":{"line":1206,"column":35}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":1209,"column":4},"end":{"line":1209,"column":26}}},{"type":"property","name":"TongzhiIcon","loc":{"start":{"line":1210,"column":4},"end":{"line":1210,"column":36}}},{"type":"property","name":"IsLeftStyle","loc":{"start":{"line":1211,"column":4},"end":{"line":1211,"column":20}}},{"type":"property","name":"BgColorStyle","loc":{"start":{"line":1212,"column":4},"end":{"line":1212,"column":21}}},{"type":"method","name":"Alert","loc":{"start":{"line":1214,"column":4},"end":{"line":1229,"column":5}}},{"type":"method","name":"CloseAlert","loc":{"start":{"line":1231,"column":4},"end":{"line":1238,"column":5}}},{"type":"property","name":"show","loc":{"start":{"line":1242,"column":4},"end":{"line":1243,"column":16}},"decorator":"track"},{"type":"method","name":"showModal","loc":{"start":{"line":1244,"column":4},"end":{"line":1246,"column":5}}},{"type":"method","name":"cancel","loc":{"start":{"line":1247,"column":4},"end":{"line":1249,"column":5}}},{"type":"property","name":"pagingShow","loc":{"start":{"line":1250,"column":4},"end":{"line":1251,"column":15}},"decorator":"track"},{"type":"property","name":"initSearchForm","loc":{"start":{"line":1256,"column":4},"end":{"line":1257,"column":36}},"decorator":"track"},{"type":"property","name":"initDataTable","loc":{"start":{"line":1258,"column":4},"end":{"line":1259,"column":35}},"decorator":"track"},{"type":"property","name":"jzData","loc":{"start":{"line":1260,"column":4},"end":{"line":1260,"column":23}},"decorator":"track"},{"type":"property","name":"tableIsLoding","loc":{"start":{"line":1261,"column":4},"end":{"line":1261,"column":32}},"decorator":"track"},{"type":"method","name":"searchData","loc":{"start":{"line":1263,"column":4},"end":{"line":1269,"column":5}}},{"type":"method","name":"pagingClick","loc":{"start":{"line":1271,"column":4},"end":{"line":1276,"column":5}}},{"type":"method","name":"getTableData","loc":{"start":{"line":1278,"column":4},"end":{"line":1333,"column":5}}},{"type":"method","name":"SelectedFn","loc":{"start":{"line":1335,"column":4},"end":{"line":1344,"column":5}}},{"type":"property","name":"jzDataDefault","loc":{"start":{"line":1348,"column":4},"end":{"line":1348,"column":30}},"decorator":"track"},{"type":"property","name":"jzDataDefaultNotChange","loc":{"start":{"line":1349,"column":4},"end":{"line":1349,"column":32}}},{"type":"property","name":"jzDataDefaultCopy","loc":{"start":{"line":1350,"column":4},"end":{"line":1350,"column":27}}},{"type":"property","name":"tableIsLodingDefault","loc":{"start":{"line":1351,"column":4},"end":{"line":1351,"column":39}},"decorator":"track"},{"type":"property","name":"initSearchFormDefalt","loc":{"start":{"line":1352,"column":4},"end":{"line":1353,"column":48}},"decorator":"track"},{"type":"property","name":"initDataTableDefault","loc":{"start":{"line":1354,"column":4},"end":{"line":1355,"column":49}},"decorator":"track"},{"type":"method","name":"getRowActions","loc":{"start":{"line":1356,"column":4},"end":{"line":1358,"column":5}}},{"type":"property","name":"sumTotal","loc":{"start":{"line":1361,"column":4},"end":{"line":1361,"column":18}}},{"type":"method","name":"getschemedetails","loc":{"start":{"line":1362,"column":4},"end":{"line":1376,"column":5}}},{"type":"property","name":"index","loc":{"start":{"line":1389,"column":4},"end":{"line":1389,"column":14}}},{"type":"method","name":"comparisonUniqueKey","loc":{"start":{"line":1390,"column":4},"end":{"line":1447,"column":5}}},{"type":"property","name":"UniqueKey","loc":{"start":{"line":1449,"column":4},"end":{"line":1449,"column":26}}},{"type":"method","name":"getTableDataDefault","loc":{"start":{"line":1450,"column":4},"end":{"line":1513,"column":5}}},{"type":"method","name":"SelectedFnDefault","loc":{"start":{"line":1515,"column":4},"end":{"line":1517,"column":5}}},{"type":"property","name":"jzDataFixedPrice","loc":{"start":{"line":1524,"column":4},"end":{"line":1524,"column":33}},"decorator":"track"},{"type":"property","name":"tableIsLodingFixedPrice","loc":{"start":{"line":1525,"column":4},"end":{"line":1525,"column":42}},"decorator":"track"},{"type":"property","name":"Lianxi","loc":{"start":{"line":1526,"column":4},"end":{"line":1526,"column":18}}},{"type":"property","name":"initSearchFormFixedPrice","loc":{"start":{"line":1527,"column":4},"end":{"line":1528,"column":56}},"decorator":"track"},{"type":"property","name":"initDataTableFixedPrice","loc":{"start":{"line":1529,"column":4},"end":{"line":1530,"column":54}},"decorator":"track"},{"type":"method","name":"getTableDataFixedPrice","loc":{"start":{"line":1532,"column":4},"end":{"line":1535,"column":5}}},{"type":"method","name":"comparativeAssignment","loc":{"start":{"line":1537,"column":4},"end":{"line":1548,"column":5}}},{"type":"method","name":"ComputeMaximumTimes","loc":{"start":{"line":1550,"column":4},"end":{"line":1560,"column":5}}},{"type":"method","name":"handleSaveFixedPrice","loc":{"start":{"line":1562,"column":4},"end":{"line":1695,"column":5}}},{"type":"property","name":"newArrsTemp3","loc":{"start":{"line":1696,"column":4},"end":{"line":1696,"column":22}}},{"type":"property","name":"newArrsTemp4","loc":{"start":{"line":1697,"column":4},"end":{"line":1697,"column":22}}},{"type":"method","name":"UpdateJZData","loc":{"start":{"line":1699,"column":4},"end":{"line":1705,"column":5}}},{"type":"property","name":"SelectedFnDataFixedPrice","loc":{"start":{"line":1707,"column":4},"end":{"line":1707,"column":41}},"decorator":"track"},{"type":"method","name":"SelectedFnFixedPrice","loc":{"start":{"line":1708,"column":4},"end":{"line":1711,"column":5}}},{"type":"method","name":"deleteFixedPrice","loc":{"start":{"line":1714,"column":4},"end":{"line":1752,"column":5}}},{"type":"property","name":"jzshows3","loc":{"start":{"line":1753,"column":4},"end":{"line":1753,"column":20}}},{"type":"method","name":"deleteFixedPriceTemp","loc":{"start":{"line":1756,"column":4},"end":{"line":1779,"column":5}}},{"type":"property","name":"ShowFix","loc":{"start":{"line":1784,"column":4},"end":{"line":1784,"column":19}},"decorator":"track"},{"type":"method","name":"showModalFix","loc":{"start":{"line":1785,"column":4},"end":{"line":1787,"column":5}}},{"type":"method","name":"cancelFix","loc":{"start":{"line":1788,"column":4},"end":{"line":1790,"column":5}}},{"type":"property","name":"initSearchFormFix","loc":{"start":{"line":1791,"column":4},"end":{"line":1792,"column":43}},"decorator":"track"},{"type":"property","name":"initDataTableFix","loc":{"start":{"line":1793,"column":4},"end":{"line":1794,"column":41}},"decorator":"track"},{"type":"property","name":"jzDataFix","loc":{"start":{"line":1796,"column":4},"end":{"line":1796,"column":26}},"decorator":"track"},{"type":"property","name":"tableIsLodingFix","loc":{"start":{"line":1797,"column":4},"end":{"line":1797,"column":35}},"decorator":"track"},{"type":"method","name":"searchDataFix","loc":{"start":{"line":1800,"column":4},"end":{"line":1805,"column":5}}},{"type":"method","name":"pagingClickFix","loc":{"start":{"line":1807,"column":4},"end":{"line":1812,"column":5}}},{"type":"property","name":"jzDataDefaultCopyQuantityList","loc":{"start":{"line":1814,"column":4},"end":{"line":1814,"column":39}}},{"type":"property","name":"ifqianpi","loc":{"start":{"line":1816,"column":4},"end":{"line":1816,"column":20}}},{"type":"method","name":"getTableDataFix","loc":{"start":{"line":1817,"column":4},"end":{"line":1900,"column":5}}},{"type":"method","name":"SelectedFnFix","loc":{"start":{"line":1902,"column":4},"end":{"line":1913,"column":5}}},{"type":"property","name":"jzDataDiscount","loc":{"start":{"line":1919,"column":4},"end":{"line":1919,"column":31}},"decorator":"track"},{"type":"property","name":"tableIsLodingDiscount","loc":{"start":{"line":1920,"column":4},"end":{"line":1920,"column":40}},"decorator":"track"},{"type":"property","name":"initSearchFormDiscount","loc":{"start":{"line":1921,"column":4},"end":{"line":1922,"column":53}},"decorator":"track"},{"type":"property","name":"initDataTableDiscount","loc":{"start":{"line":1923,"column":4},"end":{"line":1924,"column":51}},"decorator":"track"},{"type":"method","name":"getTableDataDiscount","loc":{"start":{"line":1926,"column":4},"end":{"line":1928,"column":5}}},{"type":"method","name":"UpdateDiscountData","loc":{"start":{"line":1930,"column":4},"end":{"line":1936,"column":5}}},{"type":"property","name":"SelectedFnDataDiscount","loc":{"start":{"line":1938,"column":4},"end":{"line":1938,"column":38}},"decorator":"track"},{"type":"method","name":"SelectedFnDiscount","loc":{"start":{"line":1939,"column":4},"end":{"line":1942,"column":5}}},{"type":"method","name":"delectTableDiscount","loc":{"start":{"line":1945,"column":4},"end":{"line":1957,"column":5}}},{"type":"method","name":"DeleteSchemeMatching","loc":{"start":{"line":1959,"column":4},"end":{"line":2084,"column":5}}},{"type":"property","name":"jzshows2","loc":{"start":{"line":2086,"column":4},"end":{"line":2086,"column":20}}},{"type":"method","name":"delectTableDiscountTemp","loc":{"start":{"line":2091,"column":4},"end":{"line":2117,"column":5}}},{"type":"method","name":"handleSaveDiscount","loc":{"start":{"line":2119,"column":4},"end":{"line":2343,"column":5}}},{"type":"property","name":"newArrsTemp","loc":{"start":{"line":2344,"column":4},"end":{"line":2344,"column":21}}},{"type":"property","name":"newArrsTemp2","loc":{"start":{"line":2345,"column":4},"end":{"line":2345,"column":22}}},{"type":"property","name":"ShowSpecial","loc":{"start":{"line":2349,"column":4},"end":{"line":2349,"column":23}},"decorator":"track"},{"type":"method","name":"showModalSpecial","loc":{"start":{"line":2351,"column":4},"end":{"line":2359,"column":5}}},{"type":"method","name":"cancelSpecial","loc":{"start":{"line":2360,"column":4},"end":{"line":2365,"column":5}}},{"type":"method","name":"errorTiShi","loc":{"start":{"line":2367,"column":4},"end":{"line":2371,"column":5}}},{"type":"property","name":"TyName","loc":{"start":{"line":2372,"column":4},"end":{"line":2372,"column":22}},"decorator":"track"},{"type":"property","name":"ShowSpecialError","loc":{"start":{"line":2373,"column":4},"end":{"line":2373,"column":37}}},{"type":"method","name":"SavesSpecial","loc":{"start":{"line":2375,"column":4},"end":{"line":2414,"column":5}}},{"type":"method","name":"ConsolidatedDiscountPolicy","loc":{"start":{"line":2416,"column":4},"end":{"line":2422,"column":5}}},{"type":"method","name":"ConsolidatedDiscountDetails","loc":{"start":{"line":2424,"column":4},"end":{"line":2427,"column":5}}},{"type":"property","name":"initSearchFormSpecial","loc":{"start":{"line":2428,"column":4},"end":{"line":2429,"column":51}},"decorator":"track"},{"type":"property","name":"initDataTableSpecial","loc":{"start":{"line":2430,"column":4},"end":{"line":2431,"column":49}},"decorator":"track"},{"type":"property","name":"jzDataSpecial","loc":{"start":{"line":2432,"column":4},"end":{"line":2432,"column":30}},"decorator":"track"},{"type":"property","name":"tableIsLodingSpecial","loc":{"start":{"line":2433,"column":4},"end":{"line":2433,"column":39}},"decorator":"track"},{"type":"method","name":"getTableDataSpecial","loc":{"start":{"line":2435,"column":4},"end":{"line":2471,"column":5}}},{"type":"property","name":"SelectedFnDataSpecial","loc":{"start":{"line":2473,"column":4},"end":{"line":2473,"column":38}},"decorator":"track"},{"type":"property","name":"ShowSpecialIsError","loc":{"start":{"line":2474,"column":4},"end":{"line":2474,"column":31}}},{"type":"method","name":"SelectedFnSpecial","loc":{"start":{"line":2475,"column":4},"end":{"line":2490,"column":5}}},{"type":"property","name":"IsLoading5","loc":{"start":{"line":2492,"column":4},"end":{"line":2492,"column":23}}},{"type":"property","name":"jzshows5","loc":{"start":{"line":2493,"column":4},"end":{"line":2493,"column":20}}},{"type":"property","name":"IsLoadingFlag1","loc":{"start":{"line":2494,"column":4},"end":{"line":2494,"column":26}}},{"type":"method","name":"SaveSpecialDiscount","loc":{"start":{"line":2495,"column":4},"end":{"line":2563,"column":5}}},{"type":"property","name":"initSearchFormOtherData","loc":{"start":{"line":2565,"column":4},"end":{"line":2566,"column":55}},"decorator":"track"},{"type":"property","name":"initDataTableOtherData","loc":{"start":{"line":2567,"column":4},"end":{"line":2568,"column":53}},"decorator":"track"},{"type":"property","name":"jzDataOtherData","loc":{"start":{"line":2569,"column":4},"end":{"line":2569,"column":32}},"decorator":"track"},{"type":"property","name":"tableIsLodingOtherData","loc":{"start":{"line":2570,"column":4},"end":{"line":2570,"column":41}},"decorator":"track"},{"type":"method","name":"getTableDataOtherData","loc":{"start":{"line":2572,"column":4},"end":{"line":2588,"column":5}}},{"type":"property","name":"SelectedOtherDataArr","loc":{"start":{"line":2590,"column":4},"end":{"line":2590,"column":37}},"decorator":"track"},{"type":"method","name":"SelectedFnOtherData","loc":{"start":{"line":2591,"column":4},"end":{"line":2594,"column":5}}},{"type":"property","name":"ShowCommonly","loc":{"start":{"line":2599,"column":4},"end":{"line":2599,"column":24}},"decorator":"track"},{"type":"method","name":"showModalCommonly","loc":{"start":{"line":2600,"column":4},"end":{"line":2602,"column":5}}},{"type":"property","name":"IsLoading4","loc":{"start":{"line":2604,"column":4},"end":{"line":2604,"column":23}}},{"type":"property","name":"jzshows4","loc":{"start":{"line":2605,"column":4},"end":{"line":2605,"column":20}}},{"type":"property","name":"IsLoadingFlag","loc":{"start":{"line":2606,"column":4},"end":{"line":2606,"column":25}}},{"type":"method","name":"SaveGeneralDiscount","loc":{"start":{"line":2608,"column":4},"end":{"line":2677,"column":5}}},{"type":"method","name":"cancelCommonly","loc":{"start":{"line":2679,"column":4},"end":{"line":2685,"column":5}}},{"type":"property","name":"initSearchFormCommonly","loc":{"start":{"line":2686,"column":4},"end":{"line":2687,"column":53}},"decorator":"track"},{"type":"property","name":"initDataTableCommonly","loc":{"start":{"line":2688,"column":4},"end":{"line":2689,"column":51}},"decorator":"track"},{"type":"property","name":"jzDataCommonly","loc":{"start":{"line":2690,"column":4},"end":{"line":2690,"column":31}},"decorator":"track"},{"type":"property","name":"tableIsLodingCommonly","loc":{"start":{"line":2691,"column":4},"end":{"line":2691,"column":40}},"decorator":"track"},{"type":"method","name":"getTableDataCommonly","loc":{"start":{"line":2693,"column":4},"end":{"line":2711,"column":5}}},{"type":"property","name":"SelectedFnCommonlyData","loc":{"start":{"line":2712,"column":4},"end":{"line":2712,"column":32}}},{"type":"method","name":"SelectedFnCommonly","loc":{"start":{"line":2714,"column":4},"end":{"line":2726,"column":5}}},{"type":"property","name":"SaveLb","loc":{"start":{"line":2727,"column":4},"end":{"line":2727,"column":16}}},{"type":"property","name":"SaveZk","loc":{"start":{"line":2728,"column":4},"end":{"line":2728,"column":16}}},{"type":"method","name":"handleChangeLb","loc":{"start":{"line":2730,"column":4},"end":{"line":2732,"column":5}}},{"type":"method","name":"handleChangeZk","loc":{"start":{"line":2734,"column":4},"end":{"line":2740,"column":5}}},{"type":"method","name":"errorTiShiYi","loc":{"start":{"line":2742,"column":4},"end":{"line":2745,"column":5}}},{"type":"property","name":"PromotionNoTemp","loc":{"start":{"line":2747,"column":4},"end":{"line":2747,"column":27}}},{"type":"property","name":"ShowCommonlyError","loc":{"start":{"line":2748,"column":4},"end":{"line":2748,"column":35}}},{"type":"property","name":"ShowCommonlyIsError","loc":{"start":{"line":2749,"column":4},"end":{"line":2749,"column":32}}},{"type":"method","name":"cancelSaveCommonly","loc":{"start":{"line":2750,"column":4},"end":{"line":2793,"column":5}}},{"type":"property","name":"jzDataProduct","loc":{"start":{"line":2797,"column":4},"end":{"line":2797,"column":30}},"decorator":"track"},{"type":"property","name":"tableIsLodingProduct","loc":{"start":{"line":2798,"column":4},"end":{"line":2798,"column":39}},"decorator":"track"},{"type":"property","name":"initDataTableProduct","loc":{"start":{"line":2800,"column":4},"end":{"line":2801,"column":49}},"decorator":"track"},{"type":"method","name":"getTableDataProduct","loc":{"start":{"line":2803,"column":4},"end":{"line":2805,"column":5}}},{"type":"property","name":"SelectedFnProductData","loc":{"start":{"line":2806,"column":4},"end":{"line":2806,"column":38}},"decorator":"track"},{"type":"method","name":"SelectedFnProduct","loc":{"start":{"line":2808,"column":4},"end":{"line":2811,"column":5}}},{"type":"property","name":"jzshows","loc":{"start":{"line":2813,"column":4},"end":{"line":2813,"column":19}}},{"type":"method","name":"delectTableProduct","loc":{"start":{"line":2820,"column":4},"end":{"line":2822,"column":5}}},{"type":"property","name":"ifTips","loc":{"start":{"line":2823,"column":4},"end":{"line":2823,"column":16}}},{"type":"property","name":"ifFTip","loc":{"start":{"line":2824,"column":4},"end":{"line":2824,"column":16}}},{"type":"method","name":"saveAllDataProductFn","loc":{"start":{"line":2826,"column":4},"end":{"line":2913,"column":5}}},{"type":"method","name":"HeTongPriceCompute","loc":{"start":{"line":2919,"column":4},"end":{"line":2927,"column":5}}},{"type":"property","name":"ContractPrice","loc":{"start":{"line":2929,"column":4},"end":{"line":2929,"column":22}}},{"type":"method","name":"ContractPriceCompute","loc":{"start":{"line":2930,"column":4},"end":{"line":2940,"column":5}}},{"type":"method","name":"GeneralDiscountContractSummary","loc":{"start":{"line":2942,"column":4},"end":{"line":2950,"column":5}}},{"type":"method","name":"updateIdStr","loc":{"start":{"line":2952,"column":4},"end":{"line":2980,"column":5}}},{"type":"method","name":"jumpNewQuoteEntry","loc":{"start":{"line":2982,"column":4},"end":{"line":2986,"column":5}}},{"type":"method","name":"jumpNewQuoteEntryAndSave","loc":{"start":{"line":2988,"column":4},"end":{"line":2996,"column":5}}},{"type":"method","name":"copyJzDataTableProduct","loc":{"start":{"line":2998,"column":4},"end":{"line":3016,"column":5}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.315Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/relevant/relevant.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"InspectData","type":"property"}]}],"declarationLoc":{"start":{"line":33,"column":0},"end":{"line":1165,"column":1}},"classMembers":[{"type":"property","name":"Tongzhishow","loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":18}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":37,"column":0},"end":{"line":37,"column":20}}},{"type":"property","name":"TongzhiIcon","loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":32}}},{"type":"property","name":"IsLeftStyle","loc":{"start":{"line":39,"column":0},"end":{"line":39,"column":16}}},{"type":"property","name":"BgColorStyle","loc":{"start":{"line":40,"column":0},"end":{"line":40,"column":17}}},{"type":"method","name":"Alert","loc":{"start":{"line":42,"column":0},"end":{"line":61,"column":1}}},{"type":"method","name":"CloseAlert","loc":{"start":{"line":63,"column":0},"end":{"line":72,"column":1}}},{"type":"method","name":"closeOffRefresh","loc":{"start":{"line":73,"column":0},"end":{"line":85,"column":1}}},{"type":"property","name":"IsLoading","loc":{"start":{"line":86,"column":0},"end":{"line":86,"column":18}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":88,"column":0},"end":{"line":90,"column":1}}},{"type":"property","name":"isShi","loc":{"start":{"line":93,"column":0},"end":{"line":93,"column":13}}},{"type":"property","name":"isFou","loc":{"start":{"line":94,"column":0},"end":{"line":94,"column":14}}},{"type":"property","name":"isOther","loc":{"start":{"line":95,"column":0},"end":{"line":95,"column":16}}},{"type":"property","name":"isDisable","loc":{"start":{"line":97,"column":0},"end":{"line":97,"column":18}}},{"type":"method","name":"OnLoadingWait","loc":{"start":{"line":99,"column":4},"end":{"line":106,"column":5}}},{"type":"method","name":"getQueryVariable","loc":{"start":{"line":108,"column":4},"end":{"line":117,"column":5}}},{"type":"property","name":"paramIdStr","loc":{"start":{"line":118,"column":4},"end":{"line":118,"column":19}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":119,"column":4},"end":{"line":130,"column":5}}},{"type":"method","name":"GetInspectByIdFn","loc":{"start":{"line":131,"column":4},"end":{"line":145,"column":5}}},{"type":"method","name":"checkDatas","loc":{"start":{"line":147,"column":4},"end":{"line":184,"column":5}}},{"type":"method","name":"CheckBoxAssignment","loc":{"start":{"line":186,"column":4},"end":{"line":212,"column":5}}},{"type":"method","name":"InitSearchDatas","loc":{"start":{"line":214,"column":4},"end":{"line":356,"column":5}}},{"type":"method","name":"GetIrrelevantReasonsFn","loc":{"start":{"line":357,"column":4},"end":{"line":363,"column":5}}},{"type":"property","name":"InspectData","loc":{"start":{"line":365,"column":4},"end":{"line":365,"column":28}},"decorator":"track"},{"type":"property","name":"IrrelevantReasons","loc":{"start":{"line":366,"column":4},"end":{"line":366,"column":25}}},{"type":"property","name":"RelateOption","loc":{"start":{"line":370,"column":4},"end":{"line":373,"column":5}}},{"type":"property","name":"IsRelateProjectShow","loc":{"start":{"line":374,"column":4},"end":{"line":374,"column":32}}},{"type":"method","name":"handleRelationFn","loc":{"start":{"line":377,"column":4},"end":{"line":414,"column":5}}},{"type":"property","name":"dispatchDivStyle","loc":{"start":{"line":416,"column":4},"end":{"line":416,"column":128}}},{"type":"property","name":"dispatchButtonStyle","loc":{"start":{"line":417,"column":4},"end":{"line":417,"column":83}}},{"type":"method","name":"dispatchFn","loc":{"start":{"line":419,"column":4},"end":{"line":435,"column":5}}},{"type":"method","name":"handleIrrelevantFn","loc":{"start":{"line":438,"column":4},"end":{"line":449,"column":5}}},{"type":"property","name":"otherData","loc":{"start":{"line":451,"column":4},"end":{"line":451,"column":18}}},{"type":"property","name":"saveButtonShow","loc":{"start":{"line":452,"column":4},"end":{"line":452,"column":26}}},{"type":"method","name":"handleOtherIrrelevantFn","loc":{"start":{"line":454,"column":4},"end":{"line":460,"column":5}}},{"type":"property","name":"xgxLy","loc":{"start":{"line":464,"column":4},"end":{"line":464,"column":31}}},{"type":"property","name":"xgxLyFlag","loc":{"start":{"line":465,"column":4},"end":{"line":465,"column":22}}},{"type":"property","name":"bxgLy","loc":{"start":{"line":467,"column":4},"end":{"line":467,"column":31}}},{"type":"property","name":"bxgLyFlag","loc":{"start":{"line":468,"column":4},"end":{"line":468,"column":22}}},{"type":"property","name":"qtLy","loc":{"start":{"line":470,"column":4},"end":{"line":470,"column":29}}},{"type":"property","name":"qtLyFlag","loc":{"start":{"line":471,"column":4},"end":{"line":471,"column":21}}},{"type":"method","name":"saveFn","loc":{"start":{"line":473,"column":4},"end":{"line":615,"column":5}}},{"type":"property","name":"isHospitorCheck","loc":{"start":{"line":617,"column":4},"end":{"line":617,"column":28}}},{"type":"property","name":"isrepeate1","loc":{"start":{"line":622,"column":4},"end":{"line":622,"column":23}}},{"type":"property","name":"isrepeate2","loc":{"start":{"line":623,"column":4},"end":{"line":623,"column":23}}},{"type":"property","name":"isrepeate3","loc":{"start":{"line":624,"column":4},"end":{"line":624,"column":23}}},{"type":"property","name":"isrepeate4","loc":{"start":{"line":625,"column":4},"end":{"line":625,"column":23}}},{"type":"property","name":"isrepeate5","loc":{"start":{"line":626,"column":4},"end":{"line":626,"column":23}}},{"type":"method","name":"checkZLSKIsRepeate","loc":{"start":{"line":627,"column":4},"end":{"line":671,"column":5}}},{"type":"method","name":"clear","loc":{"start":{"line":672,"column":4},"end":{"line":680,"column":5}}},{"type":"property","name":"yyId","loc":{"start":{"line":682,"column":4},"end":{"line":682,"column":14}}},{"type":"property","name":"yyIdArrs","loc":{"start":{"line":683,"column":4},"end":{"line":683,"column":18}}},{"type":"property","name":"isErrorShowYY","loc":{"start":{"line":684,"column":4},"end":{"line":684,"column":24}}},{"type":"method","name":"onsearchchange","loc":{"start":{"line":685,"column":4},"end":{"line":690,"column":5}}},{"type":"property","name":"yyId1","loc":{"start":{"line":697,"column":5},"end":{"line":697,"column":16}}},{"type":"method","name":"onsearchchange1","loc":{"start":{"line":698,"column":5},"end":{"line":706,"column":6}}},{"type":"property","name":"yyId2","loc":{"start":{"line":712,"column":4},"end":{"line":712,"column":15}}},{"type":"method","name":"onsearchchange2","loc":{"start":{"line":713,"column":5},"end":{"line":718,"column":5}}},{"type":"property","name":"yyId3","loc":{"start":{"line":726,"column":5},"end":{"line":726,"column":16}}},{"type":"method","name":"onsearchchange3","loc":{"start":{"line":727,"column":5},"end":{"line":734,"column":6}}},{"type":"property","name":"yyId4","loc":{"start":{"line":740,"column":4},"end":{"line":740,"column":15}}},{"type":"method","name":"onsearchchange4","loc":{"start":{"line":741,"column":4},"end":{"line":748,"column":5}}},{"type":"property","name":"optionZLKS","loc":{"start":{"line":756,"column":5},"end":{"line":756,"column":67}}},{"type":"property","name":"searchdataZLKS","loc":{"start":{"line":757,"column":5},"end":{"line":757,"column":23}}},{"type":"property","name":"isErrorShowZLKS","loc":{"start":{"line":758,"column":5},"end":{"line":758,"column":29}}},{"type":"method","name":"onsearchchangeZLKS","loc":{"start":{"line":759,"column":5},"end":{"line":776,"column":6}}},{"type":"property","name":"ZLKSId","loc":{"start":{"line":777,"column":5},"end":{"line":777,"column":17}}},{"type":"method","name":"selectedZLKS","loc":{"start":{"line":778,"column":5},"end":{"line":785,"column":6}}},{"type":"method","name":"InitZLKS","loc":{"start":{"line":787,"column":5},"end":{"line":796,"column":6}}},{"type":"method","name":"onclearZLKS","loc":{"start":{"line":797,"column":5},"end":{"line":803,"column":6}}},{"type":"property","name":"optionZLKS1","loc":{"start":{"line":810,"column":5},"end":{"line":810,"column":68}}},{"type":"property","name":"searchdataZLKS1","loc":{"start":{"line":811,"column":5},"end":{"line":811,"column":24}}},{"type":"method","name":"onsearchchangeZLKS1","loc":{"start":{"line":812,"column":5},"end":{"line":828,"column":6}}},{"type":"property","name":"ZLKSId1","loc":{"start":{"line":829,"column":5},"end":{"line":829,"column":18}}},{"type":"method","name":"selectedZLKS1","loc":{"start":{"line":830,"column":5},"end":{"line":835,"column":6}}},{"type":"method","name":"InitZLKS1","loc":{"start":{"line":837,"column":5},"end":{"line":846,"column":6}}},{"type":"method","name":"onclearZLKS1","loc":{"start":{"line":847,"column":5},"end":{"line":853,"column":6}}},{"type":"property","name":"optionZLKS2","loc":{"start":{"line":860,"column":4},"end":{"line":860,"column":67}}},{"type":"property","name":"searchdataZLKS2","loc":{"start":{"line":861,"column":4},"end":{"line":861,"column":23}}},{"type":"method","name":"onsearchchangeZLKS2","loc":{"start":{"line":862,"column":4},"end":{"line":877,"column":5}}},{"type":"property","name":"ZLKSId2","loc":{"start":{"line":878,"column":4},"end":{"line":878,"column":17}}},{"type":"method","name":"selectedZLKS2","loc":{"start":{"line":879,"column":4},"end":{"line":884,"column":5}}},{"type":"method","name":"InitZLKS2","loc":{"start":{"line":886,"column":4},"end":{"line":895,"column":5}}},{"type":"method","name":"onclearZLKS2","loc":{"start":{"line":896,"column":4},"end":{"line":902,"column":5}}},{"type":"property","name":"optionZLKS3","loc":{"start":{"line":907,"column":5},"end":{"line":907,"column":68}}},{"type":"property","name":"searchdataZLKS3","loc":{"start":{"line":908,"column":5},"end":{"line":908,"column":24}}},{"type":"method","name":"onsearchchangeZLKS3","loc":{"start":{"line":909,"column":5},"end":{"line":924,"column":6}}},{"type":"property","name":"ZLKSId3","loc":{"start":{"line":925,"column":5},"end":{"line":925,"column":18}}},{"type":"method","name":"selectedZLKS3","loc":{"start":{"line":926,"column":5},"end":{"line":931,"column":6}}},{"type":"method","name":"InitZLKS3","loc":{"start":{"line":933,"column":5},"end":{"line":942,"column":6}}},{"type":"method","name":"onclearZLKS3","loc":{"start":{"line":943,"column":5},"end":{"line":949,"column":6}}},{"type":"property","name":"optionZLKS4","loc":{"start":{"line":955,"column":6},"end":{"line":955,"column":69}}},{"type":"property","name":"searchdataZLKS4","loc":{"start":{"line":956,"column":6},"end":{"line":956,"column":25}}},{"type":"method","name":"onsearchchangeZLKS4","loc":{"start":{"line":957,"column":6},"end":{"line":972,"column":7}}},{"type":"property","name":"ZLKSId4","loc":{"start":{"line":973,"column":6},"end":{"line":973,"column":19}}},{"type":"method","name":"selectedZLKS4","loc":{"start":{"line":974,"column":6},"end":{"line":979,"column":7}}},{"type":"method","name":"InitZLKS4","loc":{"start":{"line":981,"column":6},"end":{"line":990,"column":7}}},{"type":"method","name":"onclearZLKS4","loc":{"start":{"line":991,"column":6},"end":{"line":997,"column":7}}},{"type":"property","name":"option5","loc":{"start":{"line":1003,"column":4},"end":{"line":1003,"column":63}}},{"type":"property","name":"searchdata5","loc":{"start":{"line":1004,"column":4},"end":{"line":1004,"column":19}}},{"type":"property","name":"isErrorShowFZR","loc":{"start":{"line":1006,"column":4},"end":{"line":1006,"column":27}}},{"type":"method","name":"onsearchchange5","loc":{"start":{"line":1008,"column":4},"end":{"line":1019,"column":5}}},{"type":"property","name":"fzrId5","loc":{"start":{"line":1020,"column":4},"end":{"line":1020,"column":16}}},{"type":"method","name":"selected5","loc":{"start":{"line":1022,"column":4},"end":{"line":1033,"column":5}}},{"type":"method","name":"onclearFZR5","loc":{"start":{"line":1036,"column":4},"end":{"line":1038,"column":5}}},{"type":"property","name":"UserList","loc":{"start":{"line":1044,"column":4},"end":{"line":1044,"column":18}}},{"type":"method","name":"checkHospital","loc":{"start":{"line":1046,"column":4},"end":{"line":1062,"column":5}}},{"type":"method","name":"SeachUserByIds","loc":{"start":{"line":1064,"column":4},"end":{"line":1072,"column":5}}},{"type":"method","name":"SeachCheckUserByName","loc":{"start":{"line":1075,"column":4},"end":{"line":1085,"column":5}}},{"type":"property","name":"value","loc":{"start":{"line":1086,"column":4},"end":{"line":1086,"column":24}}},{"type":"property","name":"options","loc":{"start":{"line":1088,"column":4},"end":{"line":1093,"column":5}}},{"type":"property","name":"selectedValues","loc":{"start":{"line":1095,"column":4},"end":{"line":1097,"column":5}}},{"type":"method","name":"handleChange","loc":{"start":{"line":1099,"column":4},"end":{"line":1102,"column":5}}},{"type":"property","name":"checkboxValue","loc":{"start":{"line":1103,"column":4},"end":{"line":1103,"column":21}}},{"type":"property","name":"checkboxValueMap","loc":{"start":{"line":1104,"column":4},"end":{"line":1104,"column":31}}},{"type":"method","name":"splieStr","loc":{"start":{"line":1106,"column":4},"end":{"line":1133,"column":5}}},{"type":"method","name":"checkbox297","loc":{"start":{"line":1134,"column":4},"end":{"line":1138,"column":5}}},{"type":"method","name":"checkbox298","loc":{"start":{"line":1139,"column":4},"end":{"line":1143,"column":5}}},{"type":"method","name":"checkbox299","loc":{"start":{"line":1144,"column":4},"end":{"line":1148,"column":5}}},{"type":"method","name":"checkbox300","loc":{"start":{"line":1149,"column":4},"end":{"line":1153,"column":5}}},{"type":"method","name":"checkbox301","loc":{"start":{"line":1154,"column":4},"end":{"line":1158,"column":5}}},{"type":"method","name":"checkbox302","loc":{"start":{"line":1159,"column":4},"end":{"line":1163,"column":5}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.274Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/tBidding/tBidding.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"InspectData","type":"property"}]}],"declarationLoc":{"start":{"line":9,"column":0},"end":{"line":353,"column":1}},"classMembers":[{"type":"property","name":"Tongzhishow","loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":18}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":20}}},{"type":"property","name":"TongzhiIcon","loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":32}}},{"type":"property","name":"IsLeftStyle","loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":16}}},{"type":"property","name":"BgColorStyle","loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":17}}},{"type":"method","name":"Alert","loc":{"start":{"line":17,"column":0},"end":{"line":36,"column":1}}},{"type":"method","name":"CloseAlert","loc":{"start":{"line":38,"column":0},"end":{"line":47,"column":1}}},{"type":"method","name":"getQueryVariable","loc":{"start":{"line":49,"column":4},"end":{"line":58,"column":5}}},{"type":"property","name":"ParamIdStr","loc":{"start":{"line":59,"column":4},"end":{"line":59,"column":19}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":60,"column":4},"end":{"line":70,"column":5}}},{"type":"property","name":"CheckResult","loc":{"start":{"line":72,"column":4},"end":{"line":72,"column":24}}},{"type":"method","name":"CheckOwner","loc":{"start":{"line":73,"column":4},"end":{"line":100,"column":5}}},{"type":"property","name":"ShowText","loc":{"start":{"line":101,"column":4},"end":{"line":101,"column":18}}},{"type":"property","name":"IrresponsibleReasons","loc":{"start":{"line":102,"column":4},"end":{"line":102,"column":30}}},{"type":"method","name":"GetIrresponsibleReasonFn","loc":{"start":{"line":103,"column":4},"end":{"line":110,"column":5}}},{"type":"property","name":"InspectData","loc":{"start":{"line":111,"column":4},"end":{"line":111,"column":28}},"decorator":"track"},{"type":"property","name":"IsSQZ","loc":{"start":{"line":112,"column":4},"end":{"line":112,"column":18}}},{"type":"property","name":"IsSQZButton","loc":{"start":{"line":113,"column":4},"end":{"line":113,"column":24}}},{"type":"method","name":"GetInspectByIdFn","loc":{"start":{"line":114,"column":4},"end":{"line":191,"column":5}}},{"type":"property","name":"IsBidArr","loc":{"start":{"line":195,"column":4},"end":{"line":198,"column":5}}},{"type":"property","name":"irresponsibleReasonShow","loc":{"start":{"line":200,"column":4},"end":{"line":200,"column":36}}},{"type":"method","name":"handleChange","loc":{"start":{"line":201,"column":4},"end":{"line":225,"column":5}}},{"type":"property","name":"bxgLy","loc":{"start":{"line":228,"column":4},"end":{"line":228,"column":31}}},{"type":"property","name":"bxgLyFlag","loc":{"start":{"line":229,"column":4},"end":{"line":229,"column":22}}},{"type":"property","name":"otherShow","loc":{"start":{"line":231,"column":4},"end":{"line":231,"column":22}}},{"type":"method","name":"handleIrresponsibleReasonsFn","loc":{"start":{"line":232,"column":4},"end":{"line":248,"column":5}}},{"type":"property","name":"qtLy","loc":{"start":{"line":252,"column":4},"end":{"line":252,"column":29}}},{"type":"property","name":"qtLyFlag","loc":{"start":{"line":253,"column":4},"end":{"line":253,"column":21}}},{"type":"method","name":"handleOtherIrrelevantFn","loc":{"start":{"line":254,"column":4},"end":{"line":259,"column":5}}},{"type":"property","name":"BCIsShow","loc":{"start":{"line":261,"column":4},"end":{"line":261,"column":21}}},{"type":"property","name":"IsBC","loc":{"start":{"line":262,"column":4},"end":{"line":262,"column":17}}},{"type":"method","name":"handleBCSMFn","loc":{"start":{"line":263,"column":4},"end":{"line":268,"column":5}}},{"type":"property","name":"YSJEIsShow","loc":{"start":{"line":272,"column":4},"end":{"line":272,"column":23}}},{"type":"property","name":"YSJEIsContent","loc":{"start":{"line":273,"column":4},"end":{"line":273,"column":23}}},{"type":"property","name":"IsYSJE","loc":{"start":{"line":274,"column":4},"end":{"line":274,"column":19}}},{"type":"method","name":"handleYSJEFn","loc":{"start":{"line":275,"column":4},"end":{"line":281,"column":5}}},{"type":"property","name":"SJCPIsShow","loc":{"start":{"line":285,"column":4},"end":{"line":285,"column":23}}},{"type":"property","name":"SJCPIsContent","loc":{"start":{"line":286,"column":4},"end":{"line":286,"column":23}}},{"type":"property","name":"IsSJCP","loc":{"start":{"line":287,"column":4},"end":{"line":287,"column":19}}},{"type":"method","name":"handleSJCPFN","loc":{"start":{"line":288,"column":4},"end":{"line":294,"column":5}}},{"type":"method","name":"saveFn","loc":{"start":{"line":296,"column":4},"end":{"line":346,"column":5}}},{"type":"method","name":"CheckFn","loc":{"start":{"line":348,"column":4},"end":{"line":352,"column":5}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.217Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/tEnquiry/tEnquiry.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"optionsdata","type":"property"},{"name":"selectdata","type":"property"},{"name":"notselectdata","type":"property"},{"name":"isselectedtable","type":"property"},{"name":"selecttitle","type":"property"},{"name":"notselecttitle","type":"property"}]}],"declarationLoc":{"start":{"line":23,"column":0},"end":{"line":487,"column":1}},"classMembers":[{"type":"property","name":"IsLoading","loc":{"start":{"line":26,"column":4},"end":{"line":26,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":27,"column":4},"end":{"line":29,"column":5}}},{"type":"property","name":"Tongzhishow","loc":{"start":{"line":31,"column":4},"end":{"line":31,"column":22}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":32,"column":4},"end":{"line":32,"column":24}}},{"type":"property","name":"TongzhiIcon","loc":{"start":{"line":33,"column":4},"end":{"line":33,"column":36}}},{"type":"property","name":"IsLeftStyle","loc":{"start":{"line":34,"column":4},"end":{"line":34,"column":20}}},{"type":"property","name":"BgColorStyle","loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":21}}},{"type":"method","name":"Alert","loc":{"start":{"line":36,"column":4},"end":{"line":52,"column":5}}},{"type":"method","name":"CloseAlert","loc":{"start":{"line":53,"column":4},"end":{"line":62,"column":5}}},{"type":"property","name":"ParamIdStr","loc":{"start":{"line":65,"column":4},"end":{"line":65,"column":20}}},{"type":"method","name":"getQueryVariable","loc":{"start":{"line":66,"column":4},"end":{"line":75,"column":5}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":76,"column":4},"end":{"line":86,"column":5}}},{"type":"property","name":"departmentId","loc":{"start":{"line":88,"column":4},"end":{"line":88,"column":22}}},{"type":"property","name":"accountIdTemp","loc":{"start":{"line":89,"column":4},"end":{"line":89,"column":22}}},{"type":"property","name":"yyId","loc":{"start":{"line":90,"column":4},"end":{"line":90,"column":14}}},{"type":"property","name":"InitSelectdata","loc":{"start":{"line":91,"column":4},"end":{"line":91,"column":23}}},{"type":"property","name":"InitNotSelectdata","loc":{"start":{"line":92,"column":4},"end":{"line":92,"column":26}}},{"type":"property","name":"hisotryData","loc":{"start":{"line":93,"column":4},"end":{"line":93,"column":21}}},{"type":"property","name":"depart_sels","loc":{"start":{"line":96,"column":4},"end":{"line":96,"column":21}}},{"type":"method","name":"InitData","loc":{"start":{"line":100,"column":4},"end":{"line":176,"column":5}}},{"type":"property","name":"optionsdata","loc":{"start":{"line":179,"column":4},"end":{"line":213,"column":5}},"decorator":"track"},{"type":"property","name":"selectdata","loc":{"start":{"line":216,"column":4},"end":{"line":217,"column":5}},"decorator":"track"},{"type":"property","name":"notselectdata","loc":{"start":{"line":220,"column":4},"end":{"line":221,"column":5}},"decorator":"track"},{"type":"property","name":"isselectedtable","loc":{"start":{"line":223,"column":4},"end":{"line":223,"column":34}},"decorator":"track"},{"type":"method","name":"initsearchdata","loc":{"start":{"line":226,"column":4},"end":{"line":231,"column":5}}},{"type":"method","name":"datachange","loc":{"start":{"line":233,"column":4},"end":{"line":237,"column":5}}},{"type":"property","name":"selected","loc":{"start":{"line":239,"column":4},"end":{"line":239,"column":18}}},{"type":"property","name":"notselected","loc":{"start":{"line":240,"column":4},"end":{"line":240,"column":21}}},{"type":"method","name":"selectedchange","loc":{"start":{"line":241,"column":4},"end":{"line":248,"column":5}}},{"type":"property","name":"selecttitle","loc":{"start":{"line":250,"column":4},"end":{"line":250,"column":32}},"decorator":"track"},{"type":"property","name":"notselecttitle","loc":{"start":{"line":251,"column":4},"end":{"line":251,"column":35}},"decorator":"track"},{"type":"property","name":"XJBMValue","loc":{"start":{"line":254,"column":4},"end":{"line":254,"column":19}}},{"type":"method","name":"handleXJBMFn","loc":{"start":{"line":255,"column":4},"end":{"line":258,"column":5}}},{"type":"method","name":"SearchFn","loc":{"start":{"line":260,"column":4},"end":{"line":286,"column":5}}},{"type":"method","name":"SaveInits","loc":{"start":{"line":288,"column":4},"end":{"line":320,"column":5}}},{"type":"method","name":"SaveFn","loc":{"start":{"line":322,"column":4},"end":{"line":354,"column":5}}},{"type":"method","name":"UpdateDatas","loc":{"start":{"line":355,"column":4},"end":{"line":380,"column":5}}},{"type":"method","name":"compareSelected","loc":{"start":{"line":382,"column":4},"end":{"line":447,"column":5}}},{"type":"method","name":"urlClickFn","loc":{"start":{"line":449,"column":4},"end":{"line":453,"column":5}}},{"type":"property","name":"option","loc":{"start":{"line":456,"column":4},"end":{"line":456,"column":62}}},{"type":"property","name":"searchdata","loc":{"start":{"line":457,"column":4},"end":{"line":457,"column":18}}},{"type":"property","name":"isErrorShowYY","loc":{"start":{"line":458,"column":4},"end":{"line":458,"column":24}}},{"type":"method","name":"onsearchchange","loc":{"start":{"line":459,"column":4},"end":{"line":469,"column":5}}},{"type":"property","name":"YYSelectedId","loc":{"start":{"line":470,"column":4},"end":{"line":470,"column":22}}},{"type":"method","name":"selectedFn","loc":{"start":{"line":471,"column":4},"end":{"line":477,"column":5}}},{"type":"method","name":"onsearchchange1","loc":{"start":{"line":479,"column":4},"end":{"line":482,"column":6}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.240Z"},{"_allAttributes":null,"_properties":null,"_methods":null,"file":"d:/Ssaleforce_vs/Product_olympus/force-app/main/default/lwc/tEnquiryNoBidding/tEnquiryNoBidding.js","metadata":{"decorators":[{"type":"track","targets":[{"name":"InspectData","type":"property"}]}],"declarationLoc":{"start":{"line":15,"column":0},"end":{"line":336,"column":1}},"classMembers":[{"type":"property","name":"IsLoading","loc":{"start":{"line":19,"column":4},"end":{"line":19,"column":22}}},{"type":"method","name":"OnLoading","loc":{"start":{"line":21,"column":4},"end":{"line":23,"column":5}}},{"type":"property","name":"Tongzhishow","loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":18}}},{"type":"property","name":"SaveShowText","loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":20}}},{"type":"property","name":"TongzhiIcon","loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":32}}},{"type":"property","name":"IsLeftStyle","loc":{"start":{"line":31,"column":0},"end":{"line":31,"column":16}}},{"type":"property","name":"BgColorStyle","loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":17}}},{"type":"method","name":"Alert","loc":{"start":{"line":33,"column":0},"end":{"line":52,"column":1}}},{"type":"method","name":"CloseAlert","loc":{"start":{"line":54,"column":0},"end":{"line":63,"column":1}}},{"type":"method","name":"getQueryVariable","loc":{"start":{"line":65,"column":4},"end":{"line":74,"column":5}}},{"type":"property","name":"ParamIdStr","loc":{"start":{"line":75,"column":4},"end":{"line":75,"column":19}}},{"type":"property","name":"ParamOIdStr","loc":{"start":{"line":76,"column":4},"end":{"line":76,"column":20}}},{"type":"property","name":"ParamPIdStr","loc":{"start":{"line":77,"column":4},"end":{"line":77,"column":20}}},{"type":"method","name":"connectedCallback","loc":{"start":{"line":80,"column":4},"end":{"line":114,"column":5}}},{"type":"method","name":"check","loc":{"start":{"line":116,"column":4},"end":{"line":131,"column":5}}},{"type":"property","name":"OpportunityObjec","loc":{"start":{"line":133,"column":4},"end":{"line":133,"column":26}}},{"type":"method","name":"checkTender","loc":{"start":{"line":135,"column":4},"end":{"line":142,"column":5}}},{"type":"property","name":"ShowText","loc":{"start":{"line":144,"column":4},"end":{"line":144,"column":18}}},{"type":"property","name":"IrresponsibleReasons","loc":{"start":{"line":145,"column":4},"end":{"line":145,"column":30}}},{"type":"method","name":"GetIrresponsibleReasonFn","loc":{"start":{"line":146,"column":4},"end":{"line":153,"column":5}}},{"type":"property","name":"InspectData","loc":{"start":{"line":154,"column":4},"end":{"line":154,"column":28}},"decorator":"track"},{"type":"property","name":"IsSQZButton","loc":{"start":{"line":155,"column":4},"end":{"line":155,"column":24}}},{"type":"method","name":"checkData","loc":{"start":{"line":156,"column":4},"end":{"line":186,"column":5}}},{"type":"property","name":"bxgLy","loc":{"start":{"line":190,"column":4},"end":{"line":190,"column":31}}},{"type":"property","name":"bxgLyFlag","loc":{"start":{"line":191,"column":4},"end":{"line":191,"column":22}}},{"type":"property","name":"otherShow","loc":{"start":{"line":193,"column":4},"end":{"line":193,"column":22}}},{"type":"method","name":"handleIrresponsibleReasonsFn","loc":{"start":{"line":194,"column":4},"end":{"line":204,"column":5}}},{"type":"property","name":"qtLy","loc":{"start":{"line":208,"column":4},"end":{"line":208,"column":29}}},{"type":"property","name":"qtLyFlag","loc":{"start":{"line":209,"column":4},"end":{"line":209,"column":21}}},{"type":"method","name":"handleOtherIrrelevantFn","loc":{"start":{"line":210,"column":4},"end":{"line":215,"column":5}}},{"type":"property","name":"BCIsShow","loc":{"start":{"line":217,"column":4},"end":{"line":217,"column":20}}},{"type":"method","name":"handleBCSMFn","loc":{"start":{"line":218,"column":4},"end":{"line":223,"column":5}}},{"type":"property","name":"YSJEIsShow","loc":{"start":{"line":227,"column":4},"end":{"line":227,"column":22}}},{"type":"property","name":"InvolveBudgetAmount__c","loc":{"start":{"line":228,"column":4},"end":{"line":228,"column":32}}},{"type":"method","name":"handleYSJEFn","loc":{"start":{"line":229,"column":4},"end":{"line":235,"column":5}}},{"type":"method","name":"saveFn","loc":{"start":{"line":238,"column":4},"end":{"line":294,"column":5}}},{"type":"property","name":"IsCheck","loc":{"start":{"line":295,"column":4},"end":{"line":295,"column":20}}},{"type":"method","name":"CheckFn","loc":{"start":{"line":299,"column":4},"end":{"line":304,"column":5}}},{"type":"method","name":"DisabledSet","loc":{"start":{"line":309,"column":4},"end":{"line":327,"column":5}}}],"exports":[{"type":"ExportDefaultDeclaration"}]},"updatedAt":"2022-03-30T04:50:23.202Z"}] |
| | |
| | | { |
| | | "defaultusername": "MEBGProduction" |
| | | "defaultusername": "vscodeOrg" |
| | | } |
| | |
| | | declare module "@salesforce/apex/InspectCheckController.GetInspectById" { |
| | | export default function GetInspectById(param: {Id: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/InspectCheckController.cannotModifyIsRelateProject" { |
| | | export default function cannotModifyIsRelateProject(param: {Id: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/InspectCheckController.GetIrrelevantReasons" { |
| | | export default function GetIrrelevantReasons(): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/InspectCheckController.GetIrresponsibleReason" { |
| | | export default function GetIrresponsibleReason(): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/InspectCheckController.GetproInvolvedManual" { |
| | | export default function GetproInvolvedManual(): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/InspectCheckController.GetIsPrentIdArr" { |
| | | export default function GetIsPrentIdArr(param: {Id: any}): Promise<any>; |
| | | } |
| | |
| | | declare module "@salesforce/apex/MaintenanceContractNotOpenController.SearchLostReportData" { |
| | | export default function SearchLostReportData(param: {Ids: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/MaintenanceContractNotOpenController.SearchMaintenance_ContractData" { |
| | | export default function SearchMaintenance_ContractData(param: {name: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/MaintenanceContractNotOpenController.GetJTYY" { |
| | | export default function GetJTYY(): Promise<any>; |
| | | } |
| | |
| | | export default function getAwsurl(param: {sobj: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.saveAgencyContact" { |
| | | export default function saveAgencyContact(param: {name: any, nameEncrypt: any, type: any, typeEncrypt: any, doctorDivision1: any, doctorDivision1Encrypt: any, agencyHospitalid: any, awsid: any}): Promise<any>; |
| | | export default function saveAgencyContact(param: {name: any, type: any, doctorDivision1: any, agencyHospitalid: any, awsid: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.getProductList" { |
| | | export default function getProductList(param: {dc: any, opdsis: any}): Promise<any>; |
| | |
| | | export default function getDoctorList(param: {hospital_id: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.saveAgencyReport" { |
| | | export default function saveAgencyReport(param: {Department_Cateogy: any, Purpose_Type: any, Agency_Report_Header: any, Agency_Hospital: any, Person_In_Charge2: any, doctor: any, Submit_date: any, Product_Category1: any, Product_Category2: any, Product_Category3: any, Result: any, Opportunity: any, StageName: any, oppAmount: any, oppOCMPrice: any, Close_Forecasted_Date: any, Report_Date: any}): Promise<any>; |
| | | export default function saveAgencyReport(param: {Department_Cateogy: any, Purpose_Type: any, SupportNeedsc: any, Agency_Report_Header: any, Agency_Hospital: any, Person_In_Charge2: any, doctor: any, Submit_date: any, Product_Category1: any, Product_Category2: any, Product_Category3: any, Result: any, Opportunity: any, StageName: any, oppAmount: any, oppOCMPrice: any, Close_Forecasted_Date: any, Report_Date: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.editAgencyReport" { |
| | | export default function editAgencyReport(param: {Agency_Report_Id: any, Department_Cateogy: any, Purpose_Type: any, Agency_Report_Header: any, Agency_Hospital: any, Person_In_Charge2: any, doctor: any, Submit_date: any, Product_Category1: any, Product_Category2: any, Product_Category3: any, Result: any, Opportunity: any, StageName: any, oppAmount: any, oppOCMPrice: any, Close_Forecasted_Date: any, Report_Date: any}): Promise<any>; |
| | | export default function editAgencyReport(param: {Agency_Report_Id: any, Department_Cateogy: any, Purpose_Type: any, SupportNeedsc: any, Agency_Report_Header: any, Agency_Hospital: any, Person_In_Charge2: any, doctor: any, Submit_date: any, Product_Category1: any, Product_Category2: any, Product_Category3: any, Result: any, Opportunity: any, StageName: any, oppAmount: any, oppOCMPrice: any, Close_Forecasted_Date: any, Report_Date: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.selectOpportunityByIdAndHospitalLinkId" { |
| | | export default function selectOpportunityByIdAndHospitalLinkId(param: {opportunity_id: any, agency_hospital_link_id: any}): Promise<any>; |
| | |
| | | declare module "@salesforce/apex/WeeklyReportCmp.getReportsByDate" { |
| | | export default function getReportsByDate(param: {date1: any, date2: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.processDataAWSId" { |
| | | export default function processDataAWSId(param: {fileData: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.processData" { |
| | | export default function processData(param: {fileData: any, sobjectName: any, fields: any}): Promise<any>; |
| | | } |
| | | declare module "@salesforce/apex/WeeklyReportCmp.searchAgencyDataId" { |
| | | export default function searchAgencyDataId(param: {hospitalId: any}): Promise<any>; |
| | | } |
| | |
| | | compareDocumentPosition(otherNode: Node): number; |
| | | contains(otherNode: Node): boolean; |
| | | elementFromPoint(x: number, y: number): Element | null; |
| | | querySelector<K extends keyof HTMLElementTagNameMap>( |
| | | selectors: K |
| | | ): HTMLElementTagNameMap[K] | null; |
| | | querySelector<K extends keyof SVGElementTagNameMap>( |
| | | selectors: K |
| | | ): SVGElementTagNameMap[K] | null; |
| | | querySelector<E extends Element = Element>(selectors: string): E | null; |
| | | querySelectorAll<K extends keyof HTMLElementTagNameMap>( |
| | | selectors: K |
| | | ): NodeListOf<HTMLElementTagNameMap[K]>; |
| | | querySelectorAll<K extends keyof SVGElementTagNameMap>( |
| | | selectors: K |
| | | ): NodeListOf<SVGElementTagNameMap[K]>; |
| | | querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>; |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * Decorator factory to wire a property or method to a wire adapter data source |
| | | * @param getType imperative accessor for the data source |
| | | * @param config configuration object for the accessor |
| | | * @param adapter the adapter used to provision data |
| | | * @param config configuration object for the adapter |
| | | */ |
| | | export function wire(getType: (config?: any) => any, config?: any): PropertyDecorator; |
| | | export function wire( |
| | | adapter: WireAdapterConstructor | LegacyWireAdapterConstructor, |
| | | config?: WireConfigValue |
| | | ): PropertyDecorator; |
| | | |
| | | type LegacyWireAdapterConstructor = (config?: any) => any; |
| | | type WireConfigValue = Record<string, any>; |
| | | type ContextValue = Record<string, any>; |
| | | |
| | |
| | | export function getMetrics(request: string): void; |
| | | } |
| | | |
| | | declare module 'lightning/salesEnablementProgramApi' { |
| | | /** |
| | | * Wire adapter for getting Sales Enablement Program templates list. |
| | | */ |
| | | export function getProgramTemplates(): void; |
| | | } |
| | | |
| | | declare module 'lightning/analyticsWaveApi' { |
| | | /** |
| | | * A Tableau CRM dataflow node. |
| | |
| | | ## OlyMEBGProduct |
| | | # Salesforce DX Project: Next Steps |
| | | |
| | | Now that you’ve created a Salesforce DX project, what’s next? Here are some documentation resources to get you started. |
| | | |
| | | ## How Do You Plan to Deploy Your Changes? |
| | | |
| | | Do you want to deploy a set of changes, or create a self-contained application? Choose a [development model](https://developer.salesforce.com/tools/vscode/en/user-guide/development-models). |
| | | |
| | | ## Configure Your Salesforce DX Project |
| | | |
| | | The `sfdx-project.json` file contains useful configuration information for your project. See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm) in the _Salesforce DX Developer Guide_ for details about this file. |
| | | |
| | | ## Read All About It |
| | | |
| | | - [Salesforce Extensions Documentation](https://developer.salesforce.com/tools/vscode/) |
| | | - [Salesforce CLI Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm) |
| | | - [Salesforce DX Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm) |
| | | - [Salesforce CLI Command Reference](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference.htm) |
| New file |
| | |
| | | <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:isUrlAddressable" > |
| | | <aura:attribute name = "recordId" type = "Id" default = ""/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <c:NewAgencyContact> |
| | | <aura:set attribute="isClone" value="true"/> |
| | | <aura:set attribute="recordId" value="{!v.recordId}"/> |
| | | </c:NewAgencyContact> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>50.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | ({ |
| | | doInit : function(component, event, helper) { |
| | | |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <aura:component controller="DealerPersonnelController" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global"> |
| | | <!-- 批量添加周报 start--> |
| | | <!-- <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> --> |
| | | <aura:attribute name="reports_date" type="List" /> |
| | | <aura:attribute name="errorMessage" type="String" /> |
| | | <aura:attribute name="TableContent" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TableContent2" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TargetFileName" type="String" description="Name of the file" /> |
| | | <aura:attribute name="tableheaders" type="Object[]" /> |
| | | <aura:attribute name="fileContentData" type="String" /> |
| | | <aura:attribute name="filename" type="String" /> |
| | | <aura:attribute name="NumOfRecords" type="Integer" default="1000" /> |
| | | <aura:attribute name="showMain" type="Boolean" default="true" /> |
| | | <aura:attribute name="IsEventDefault" type="Boolean" default="true" /> |
| | | <aura:attribute name="login" type="Boolean" default="false" /> |
| | | <aura:attribute name="successMessage" type="String" /> |
| | | <!-- 批量添加周报 end--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | <!-- 批量添加周报 start--> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001"> |
| | | <ui:inputText aura:id="articleURL" /> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_error" role="status"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="error" iconName="utility:error" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01"> |
| | | <ui:inputText aura:id="articleURL" /> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_success" role="alert"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="Success" iconName="utility:success" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.successMessage}</h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div > |
| | | <div class="slds-modal__header "> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">客户人员批量导入</h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium "> |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div> |
| | | <center> |
| | | <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" /> |
| | | </center> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}" /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="保存" variant="brand" onclick="{!c.processFileContent}" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.cancel}" /> |
| | | </div> |
| | | |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 批量添加周报 end--> |
| | | |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS .bcolor { |
| | | color: #333; |
| | | } |
| | | .THIS.height100vh { |
| | | height: 100vh; |
| | | } |
| | | .THIS.contents_wrapper { |
| | | padding-top: 50px; |
| | | } |
| | | .THIS .mt5 { |
| | | margin-top: 5px; |
| | | } |
| | | .THIS .mt40 { |
| | | margin-top: 40px; |
| | | } |
| | | .THIS .edit_button { |
| | | float: right; |
| | | margin: -1.5em 0.5em 0 0; |
| | | border: 0; |
| | | } |
| | | .THIS .no_data_area { |
| | | text-align: center; |
| | | margin: .5em 0; |
| | | } |
| | | .THIS.report_list_area { |
| | | margin: 40px 0 20px 100px; |
| | | height: 60vh; |
| | | overflow-y: scroll; |
| | | } |
| | | .THIS .report_radio { |
| | | float: left; |
| | | } |
| | | .THIS .table_header { |
| | | width: 9.4rem; |
| | | height: 2em; |
| | | } |
| | | .THIS.disp_none { |
| | | display: none; |
| | | } |
| | | .THIS .disp_none { |
| | | display: none; |
| | | } |
| | | .THIS .tr { |
| | | text-align: right; |
| | | } |
| | | .THIS .close_button { |
| | | float: right; |
| | | margin-top: -2em; |
| | | } |
| | | .THIS .close_icn svg { |
| | | fill: #fefefe; |
| | | } |
| | | .THIS .slds-progress__marker { |
| | | cursor: default; |
| | | } |
| | | .THIS .progress_0 { |
| | | width: 0%; |
| | | } |
| | | .THIS .progress_100 { |
| | | width: 100%; |
| | | } |
| | | .THIS .new_btn_area { |
| | | text-align: center; |
| | | margin-top: 22px; |
| | | } |
| | | .THIS .new_btn { |
| | | width: 100%; |
| | | } |
| | | .THIS .save_button_area { |
| | | margin: 1em 0; |
| | | text-align: right; |
| | | } |
| | | .THIS .save_button { |
| | | background-color: #ffa500; |
| | | border: 1px solid #ff8c00; |
| | | } |
| | | .THIS .report_data_header { |
| | | border-bottom: 2px solid #ccc; |
| | | } |
| | | .THIS .report_data_area { |
| | | border-bottom: 1px solid #ccc; |
| | | } |
| | | .THIS.fade { |
| | | transition: 5s opacity linear; |
| | | } |
| | | .THIS.animation_off { |
| | | opacity: 0; |
| | | } |
| | | .THIS.animation_on { |
| | | opacity: 1; |
| | | } |
| | | .THIS .fade { |
| | | transition: 5s opacity linear; |
| | | } |
| | | .THIS .animation_off { |
| | | opacity: 0; |
| | | } |
| | | .THIS .animation_on { |
| | | opacity: 1; |
| | | } |
| | | .THIS .divbotuser{ |
| | | width:fit-content; |
| | | } |
| | | |
| | | .THIS .toastMessage.forceActionsText{ |
| | | white-space : pre-line !important; |
| | | } |
| | | |
| | | .THIS .slds-file-selector__dropzone .slds-file-selector__text{ |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .slds-input:focus, .THIS .slds-input:active { |
| | | border-color: rgb(216, 221, 230); |
| | | box-shadow: none; |
| | | } |
| | | |
| | | .THIS .customRequired{ |
| | | font-weight: 400; |
| | | } |
| | | .THIS .customRequired:before{ |
| | | content: "*"; |
| | | margin: 0 0.125rem 0 0.125rem; |
| | | color: rgb(194, 57, 52); |
| | | float: left; |
| | | } |
| | | .THIS .none{ |
| | | display:none; |
| | | } |
| New file |
| | |
| | | <design:component > |
| | | |
| | | </design:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" /> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" /> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | CreateRecord : function(component, event, helper){ |
| | | var files = event.getSource().get("v.files"); |
| | | helper.readFile(component,helper,files[0]); |
| | | }, |
| | | processFileContent : function(component,event,helper){ |
| | | helper.saveRecords(component,event,helper); |
| | | }, |
| | | cancel : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | readFile: function (component, helper, file) { |
| | | if (!file) return; |
| | | if (!file.name.match(/\.(csv||CSV)$/)) { |
| | | return alert('only support csv files'); |
| | | } else { |
| | | reader = new FileReader(); |
| | | reader.onerror = function errorHandler(evt) { |
| | | switch (evt.target.error.code) { |
| | | case evt.target.error.NOT_FOUND_ERR: |
| | | alert('File Not Found!'); |
| | | break; |
| | | case evt.target.error.NOT_READABLE_ERR: |
| | | alert('File is not readable'); |
| | | break; |
| | | case evt.target.error.ABORT_ERR: |
| | | break; // noop |
| | | default: |
| | | alert('An error occurred reading this file.'); |
| | | }; |
| | | } |
| | | reader.onabort = function (e) { |
| | | alert('File read cancelled'); |
| | | }; |
| | | reader.onloadstart = function (e) { |
| | | var output = '<ui type=\"disc\"><li><strong>' + file.name + '</strong> (' + file.type + ')- ' + file.size + 'bytes, last modified: ' + file.lastModifiedDate.toLocaleDateString() + '</li></ui>'; |
| | | component.set("v.filename", file.name); |
| | | component.set("v.TargetFileName", output); |
| | | }; |
| | | reader.onload = function (e) { |
| | | var data = e.target.result; |
| | | // data.replace(/\n/,"") |
| | | var allTextLines11 = data.split(/\r/); |
| | | var s = allTextLines11.toString(); |
| | | component.set("v.fileContentData", s); |
| | | console.log("file dataqqq" + JSON.stringify(s)); |
| | | var allTextLines = data.split(/\r\n|\n/); |
| | | var dataRows = allTextLines.length - 1; |
| | | var headers = allTextLines[0].split(','); |
| | | var numOfRows = component.get("v.NumOfRecords"); |
| | | if (dataRows > numOfRows + 1 || dataRows == 1 || dataRows == 0) { |
| | | alert("File Rows between 1 to " + numOfRows + " ."); |
| | | component.set("v.showMain", true); |
| | | } |
| | | else { |
| | | var lines = []; |
| | | var filecontentdata; |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | content += '<th scope=\"col"\>' + '行号' + '</th>'; |
| | | for (i = 0; i < headers.length; i++) { |
| | | content += '<th scope=\"col"\>' + headers[i] + '</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | for (var i = 1; i < allTextLines.length; i++) { |
| | | filecontentdata = allTextLines[i].split(','); |
| | | if (filecontentdata[0] != '') { |
| | | content += "<tr>"; |
| | | content += "<td>" + i + "</td>"; |
| | | for (var j = 0; j < filecontentdata.length; j++) { |
| | | content += '<td>' + filecontentdata[j] + '</td>'; |
| | | } |
| | | content += "</tr>"; |
| | | } |
| | | } |
| | | content += "</table>"; |
| | | console.log(content); |
| | | component.set("v.TableContent", content); |
| | | component.set("v.showMain", false); |
| | | } |
| | | } |
| | | reader.readAsText(file, 'gb2312'); |
| | | |
| | | } |
| | | var reader = new FileReader(); |
| | | reader.onloadend = function () { |
| | | }; |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | saveRecords: function (component, event, helper) { |
| | | component.set('v.login', true); |
| | | var action = component.get("c.processData"); |
| | | var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic fields |
| | | action.setParams({ |
| | | fileData: component.get("v.fileContentData"), |
| | | sobjectName: 'Account', //Any object |
| | | fields: fieldsList |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | if (res != 'success') { |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | for (var i = 0; i < ress.length; i++) { |
| | | res1 += ress[i].substr(7) + '\n'; |
| | | } |
| | | console.log("==" + res1); |
| | | // this.error( "请修改后重新上传"); |
| | | component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } else { |
| | | // this.success('导入成功'); |
| | | component.set('v.successMessage', '导入成功'); |
| | | this.showSuccessToast01(component); |
| | | component.set("v.showMain", true); |
| | | component.set('v.login', false); |
| | | } |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | component.set('v.login', false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | component.set('v.login', false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set('v.login', false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast01: function (component) { |
| | | $A.util.removeClass(component.find('successDiv01'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv01'), 'slds-hide'); |
| | | }), |
| | | 3000 |
| | | ); |
| | | }, |
| | | //弹出 错误提示 |
| | | showErrorToast: function (component) { |
| | | $A.util.removeClass(component.find('errorDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | 4000 |
| | | ); |
| | | }, |
| | | success : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title" : "成功!", |
| | | "message" : message, |
| | | "duration" : "5000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | warning : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "警告!", |
| | | "message": message, |
| | | "duration" : "10000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | error : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "duration" : "sticky" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:application access="public" extends="ltng:outApp" > |
| | | <aura:dependency resource="c:DealerPersonnelInformationImport"/> |
| | | </aura:application> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <description>A Lightning Application Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:application access="public" extends="ltng:outApp"> |
| | | <aura:dependency resource="c:ImprovedForecastTimeApp"/> |
| | | </aura:application> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <description>A Lightning Application Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 07-08-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global" |
| | | controller="NewAgencyContactController"> |
| | | |
| | |
| | | <aura:attribute name="isClone" type="Boolean" default = "False"/> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <aura:registerEvent name="NewAgencyContactEvent" type="c:NewAgencyContactEvent"/> |
| | | |
| | | <div class="{! v.container_class}"> |
| | | <!-- header --> |
| | |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | console.log('item.field = ' + item.field); |
| | | if(rv.Data.data.hasOwnProperty(item.field)){ |
| | | item.value = rv.Data.data[item.field]; |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | }else{ |
| | | |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | |
| | | let url = staticResource.newUrl; |
| | | let payloadPi = {}; |
| | | if (record_id && !isClone) { |
| | | url = staticResource.updateUrl |
| | | url = staticResource.updateUrl; |
| | | payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c; |
| | | } |
| | | let layout = component.get('v.layout'); |
| | | |
| | | let pi_fields_map = component.get('v.pi_fields_map'); |
| | | |
| | | let hospitalId = ''; |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | hospitalId = item.value; |
| | | } |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | |
| | | payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = item.value; |
| | |
| | | } |
| | | |
| | | component.set("v.showSpinner", true); |
| | | helper.AwsPost(url, [payloadPi], function(result){ |
| | | |
| | | let obj = result.object[0]; |
| | | let data = {}; |
| | | if(record_id && !isClone){ |
| | | data.Id = record_id; |
| | | }else{ |
| | | data.AWS_Data_Id__c = obj.dataId; |
| | | } |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field && item.behavior != "Readonly"){ |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c]; |
| | | data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c]; |
| | | }else{ |
| | | data[item.field] = item.value; |
| | | } |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | hospitalId : hospitalId |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | $A.getCallback(function(){ |
| | | helper.CallBackAction(component,'Save',{ |
| | | data : data, |
| | | transId : result.txId |
| | | },function(data){ |
| | | component.set("v.showSpinner", false); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | var sfId = null; |
| | | if(rv.IsSuccess){ |
| | | sfId = rv.Data.recordId; |
| | | } |
| | | |
| | | helper.AwsPost(staticResource.transactionUrl,{ |
| | | txId: result.txId, |
| | | sfRecordId:sfId, |
| | | isSuccess: rv.IsSuccess ? 1 : 0 |
| | | },function(data){ |
| | | if(rv.IsSuccess){ |
| | | helper.ShowToast({ |
| | | "message" : "成功", |
| | | "type" : "success" |
| | | }); |
| | | |
| | | if (record_id && !isClone){ |
| | | |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | $A.get('e.force:refreshView').fire(); |
| | | }else{ |
| | | var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | sObjectEvent.setParams({ |
| | | "recordId": sfId |
| | | }) |
| | | sObjectEvent.fire(); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | },staticResource.token); |
| | | |
| | | |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | payloadPi['agencyContactIds'] = agencyContactIds; |
| | | }else{ |
| | | |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | |
| | | payloadPi['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | helper.AwsPost(url+'V2', [payloadPi], function(result){ |
| | | //如果返回是129表示重复了,报错 |
| | | if(result.status == '129'){ |
| | | helper.ShowToast({ |
| | | "message" : '该客户人员名字已存在,在'+hospitalName+'医院,请修改', |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | return |
| | | } |
| | | |
| | | let obj = result.object[0]; |
| | | let data = {}; |
| | | if(record_id && !isClone){ |
| | | data.Id = record_id; |
| | | }else{ |
| | | data.AWS_Data_Id__c = obj.dataId; |
| | | } |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field && item.behavior != "Readonly"){ |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c]; |
| | | //data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c]; |
| | | }else{ |
| | | data[item.field] = item.value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | $A.getCallback(function(){ |
| | | helper.CallBackAction(component,'Save',{ |
| | | data : data, |
| | | transId : result.txId |
| | | },function(data){ |
| | | component.set("v.showSpinner", false); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | var sfId = null; |
| | | if(rv.IsSuccess){ |
| | | sfId = rv.Data.recordId; |
| | | } |
| | | |
| | | helper.AwsPost(staticResource.transactionUrl,{ |
| | | txId: result.txId, |
| | | sfRecordId:sfId, |
| | | isSuccess: rv.IsSuccess ? 1 : 0 |
| | | },function(data){ |
| | | if(rv.IsSuccess){ |
| | | helper.ShowToast({ |
| | | "message" : "成功", |
| | | "type" : "success" |
| | | }); |
| | | if (record_id && !isClone){ |
| | | |
| | | helper.closeAgencyContact(component); |
| | | //$A.get('e.force:refreshView').fire(); |
| | | }else{ |
| | | var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | sObjectEvent.setParams({ |
| | | "recordId": sfId |
| | | }) |
| | | sObjectEvent.fire(); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | },staticResource.token); |
| | | |
| | | |
| | | }else{ |
| | | |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | })(); |
| | | |
| | | }, staticResource.token); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | }); |
| | | })(); |
| | | component.set("v.showSpinner", false); |
| | | } |
| | | }); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | |
| | | // helper.AwsPost(url, [payloadPi], function(result){ |
| | | |
| | | }, staticResource.token); |
| | | // let obj = result.object[0]; |
| | | // let data = {}; |
| | | // if(record_id && !isClone){ |
| | | // data.Id = record_id; |
| | | // }else{ |
| | | // data.AWS_Data_Id__c = obj.dataId; |
| | | // } |
| | | // for(let s of layout){ |
| | | // for(let c of s.layoutColumns){ |
| | | // for(let item of c.layoutItems){ |
| | | // if(item.field && item.behavior != "Readonly"){ |
| | | // if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | // data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c]; |
| | | // data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c]; |
| | | // }else{ |
| | | // data[item.field] = item.value; |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // $A.getCallback(function(){ |
| | | // helper.CallBackAction(component,'Save',{ |
| | | // data : data, |
| | | // transId : result.txId |
| | | // },function(data){ |
| | | // component.set("v.showSpinner", false); |
| | | // if(data.getState() == "SUCCESS"){ |
| | | // var rv = data.getReturnValue(); |
| | | // console.log(rv); |
| | | // var sfId = null; |
| | | // if(rv.IsSuccess){ |
| | | // sfId = rv.Data.recordId; |
| | | // } |
| | | |
| | | // helper.AwsPost(staticResource.transactionUrl,{ |
| | | // txId: result.txId, |
| | | // sfRecordId:sfId, |
| | | // isSuccess: rv.IsSuccess ? 1 : 0 |
| | | // },function(data){ |
| | | // if(rv.IsSuccess){ |
| | | // helper.ShowToast({ |
| | | // "message" : "成功", |
| | | // "type" : "success" |
| | | // }); |
| | | |
| | | // if (record_id && !isClone){ |
| | | |
| | | // $A.get("e.force:closeQuickAction").fire(); |
| | | // $A.get('e.force:refreshView').fire(); |
| | | // }else{ |
| | | // var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | // sObjectEvent.setParams({ |
| | | // "recordId": sfId |
| | | // }) |
| | | // sObjectEvent.fire(); |
| | | // } |
| | | // }else{ |
| | | // helper.ShowToast({ |
| | | // "message" : rv.Message, |
| | | // "type" : "error" |
| | | // }); |
| | | // } |
| | | // },staticResource.token); |
| | | |
| | | |
| | | // }else{ |
| | | |
| | | // helper.ShowToast({ |
| | | // "message" : "Init error", |
| | | // "type" : "error" |
| | | // }); |
| | | |
| | | // } |
| | | // }); |
| | | // })(); |
| | | |
| | | // }, staticResource.token); |
| | | }, |
| | | cancelClick : function(component, event, helper){ |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | //document.getElementById('NewAgencyContact').remove(); |
| | | //component.set('v.showNewAgencyContact', false); |
| | | }, |
| | | |
| | | scriptsLoaded : function(component, event, helper){} |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 07-08-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global" |
| | | controller="NewAgencyContactController"> |
| | | |
| | | <aura:attribute name = "recordId" type = "Id" default = ""/> |
| | | <aura:attribute name="title" type="string"/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper"/> |
| | | <aura:attribute name="record_data" type="Map"/> |
| | | <aura:attribute name="section_names" type="List"/> |
| | | <aura:attribute name="showSpinner" type="Boolean" default = "False"/> |
| | | <aura:attribute name="staticResource" type="Map"/> |
| | | <aura:attribute name="pi_fields_map" type="Map"/> |
| | | <aura:attribute name="isClone" type="Boolean" default = "False"/> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <aura:registerEvent name="NewAgencyContactEvent" type="c:NewAgencyContactEvent"/> |
| | | |
| | | <div class="{! v.container_class}"> |
| | | <!-- header --> |
| | | <header class="slds-modal__header"> |
| | | <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate"> |
| | | {!v.title} |
| | | </h2> |
| | | </header> |
| | | |
| | | <div class="slds-modal__content slds-p-around_medium"> |
| | | <aura:if isTrue="{!v.showSpinner}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" /> |
| | | </aura:if> |
| | | |
| | | |
| | | <lightning:recordEditForm objectApiName="Agency_Contact__c"> |
| | | |
| | | <lightning:accordion activeSectionName="{! v.section_names }" allowMultipleSectionsOpen="true" class="greyyyy" > |
| | | <aura:iteration items="{!v.layout}" var="section"> |
| | | <aura:if isTrue="{! section.editHeading }"> |
| | | <lightning:accordionSection name="{! section.label }" label="{! section.label }"> |
| | | |
| | | <aura:iteration items="{! section.layoutColumns}" var="col"> |
| | | <aura:iteration items="{! col.layoutItems}" var="field"> |
| | | <aura:if isTrue="{! field.behavior != 'Readonly' }"> |
| | | <lightning:inputField required="{! field.behavior == 'Required' }" aura:id="field" fieldName="{! field.field}" value="{! field.value}" /> |
| | | |
| | | </aura:if> |
| | | </aura:iteration> |
| | | |
| | | </aura:iteration> |
| | | |
| | | |
| | | </lightning:accordionSection> |
| | | </aura:if> |
| | | </aura:iteration> |
| | | </lightning:accordion> |
| | | </lightning:recordEditForm> |
| | | |
| | | <div style="text-align:center;margin: 5px;"> |
| | | <lightning:button class="slds-button slds-button_neutral" label="取消" onclick="{! c.cancelClick }" /> |
| | | <lightning:button class="slds-button slds-button_brand" variant="brand" label="保存" onclick="{! c.saveClick }" /> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS { |
| | | } |
| | | |
| | | .THIS .greyyyy .slds-button_reset{ |
| | | display: flex; |
| | | align-items: center; |
| | | background: var(--lwc-colorBackground,rgb(243, 242, 242)); |
| | | cursor: pointer; |
| | | width: 100%; |
| | | height: 2rem; |
| | | text-align: left; |
| | | color: currentColor; |
| | | font-size: inherit; |
| | | padding: 0 var(--lwc-spacingXSmall,0.5rem); |
| | | } |
| New file |
| | |
| | | <design:component > |
| | | |
| | | </design:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" /> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" /> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | doInit : function(component, event, helper) { |
| | | let rid = component.get('v.recordId'); |
| | | let pid = null; |
| | | if(!rid){ |
| | | pid = window.location.href.replace("https://","").split("/")[4]; |
| | | } |
| | | let isClone = component.get('v.isClone'); |
| | | if(!rid || isClone){ |
| | | component.set('v.title',$A.get("$Label.c.New")+'.客户人员'); |
| | | }else{ |
| | | component.set('v.title',$A.get("$Label.c.Edit")+'.客户人员'); |
| | | } |
| | | |
| | | let record_type_id = null; |
| | | let pageref = component.get("v.pageReference") |
| | | if(!record_type_id && pageref){ |
| | | record_type_id = pageref.state.recordTypeId |
| | | } |
| | | component.set("v.showSpinner", true); |
| | | helper.CallBackAction(component,'Init',{ |
| | | rid : rid, |
| | | pid : null, |
| | | //rid : component.get('v.recordId'), |
| | | record_type_id : record_type_id, |
| | | },function(data){ |
| | | debugger |
| | | component.set("v.showSpinner", false); |
| | | |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | if(rv.IsSuccess){ |
| | | let layout = JSON.parse(rv.Data.layout); |
| | | let fields = rv.Data.fields; |
| | | let staticResource = JSON.parse(rv.Data.staticResource); |
| | | let staticResourceV2 = JSON.parse(rv.Data.staticResourceV2); |
| | | let section_names = []; |
| | | section_names = layout.map(s=>s.label); |
| | | component.set('v.section_names',section_names); |
| | | |
| | | let m = {}; |
| | | for(let f of staticResource.PIDetails){ |
| | | m[f.SF_Field_API_Name__c] = f; |
| | | } |
| | | component.set('v.pi_fields_map',m); |
| | | |
| | | |
| | | |
| | | if(rv.Data && rv.Data.data && rv.Data.data.AWS_Data_Id__c){ |
| | | helper.AwsGet(staticResource.queryUrl, { |
| | | dataId : rv.Data.data.AWS_Data_Id__c |
| | | }, function(data){ |
| | | console.log('data = ' + data); |
| | | |
| | | for(let f of staticResource.PIDetails){ |
| | | |
| | | if(data.object && data.object.hasOwnProperty(f.AWS_Field_API__c)){ |
| | | rv.Data.data[f.SF_Field_API_Name__c] = data.object[f.AWS_Field_API__c]; |
| | | if(data.object.hasOwnProperty(f.AWS_Encrypted_Field_API__c) && data.object[f.AWS_Encrypted_Field_API__c]){ |
| | | rv.Data.data[f.SF_Field_Encrypted_API__c] = data.object[f.AWS_Encrypted_Field_API__c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(rv.Data.data.hasOwnProperty(item.field)){ |
| | | item.value = rv.Data.data[item.field]; |
| | | } |
| | | |
| | | if(fields.hasOwnProperty(item.field)){ |
| | | item.fi = fields[item.field]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | component.set('v.record_data',rv.Data.data); |
| | | component.set('v.layout',layout); |
| | | }, staticResource.token); |
| | | }else{ |
| | | |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(rv.Data && fields.hasOwnProperty(item.field) && fields[item.field].References && fields[item.field].References.map(m=>m.value).indexOf(rv.Data.pidType) > -1){ |
| | | item.value = pid; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | component.set('v.layout',layout); |
| | | } |
| | | |
| | | |
| | | component.set('v.fields',fields); |
| | | component.set('v.staticResource',staticResource); |
| | | component.set('v.staticResourceV2',staticResourceV2); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | |
| | | }else{ |
| | | |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | saveClick : function(component, event, helper){ |
| | | |
| | | let staticResource = component.get('v.staticResource'); |
| | | //let staticResourceV2 = component.get('v.staticResourceV2'); |
| | | let record_id = component.get('v.recordId'); |
| | | let record_type_id = component.get('v.recordTypeId'); |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | let url = staticResource.newUrl; |
| | | //let urlV2 = staticResourceV2.newUrl; |
| | | let payloadPi = {}; |
| | | if (record_id && !isClone) { |
| | | url = staticResource.updateUrl; |
| | | //urlV2 = staticResourceV2.updateUrl; |
| | | payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c; |
| | | } |
| | | let layout = component.get('v.layout'); |
| | | |
| | | let pi_fields_map = component.get('v.pi_fields_map'); |
| | | |
| | | let hospitalId = ''; |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | hospitalId = item.value; |
| | | } |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | |
| | | payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = item.value; |
| | | } |
| | | |
| | | if (item.behavior == "Required" && !item.value ) { |
| | | let fs = component.find("field"); |
| | | for(let fi in fs){ |
| | | let f = fs[fi]; |
| | | if(!f.get('v.value')){ |
| | | f.reset(); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | component.set("v.showSpinner", true); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | hospitalId : hospitalId |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | payloadPi['agencyContactIds'] = agencyContactIds; |
| | | }else{ |
| | | payloadPi['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | helper.AwsPost(url+'V2', [payloadPi], function(result){ |
| | | //如果返回是129表示重复了,报错 |
| | | if(result.status == '129'){ |
| | | helper.ShowToast({ |
| | | "message" : '该客户人员名字已存在,在'+hospitalName+'医院,请修改', |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | return |
| | | } |
| | | |
| | | let obj = result.object[0]; |
| | | let data = {}; |
| | | if(record_id && !isClone){ |
| | | data.Id = record_id; |
| | | }else{ |
| | | data.AWS_Data_Id__c = obj.dataId; |
| | | } |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field && item.behavior != "Readonly"){ |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c]; |
| | | //data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c]; |
| | | }else{ |
| | | data[item.field] = item.value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | $A.getCallback(function(){ |
| | | helper.CallBackAction(component,'Save',{ |
| | | data : data, |
| | | transId : result.txId |
| | | },function(data){ |
| | | component.set("v.showSpinner", false); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | var sfId = null; |
| | | if(rv.IsSuccess){ |
| | | sfId = rv.Data.recordId; |
| | | } |
| | | |
| | | helper.AwsPost(staticResource.transactionUrl,{ |
| | | txId: result.txId, |
| | | sfRecordId:sfId, |
| | | isSuccess: rv.IsSuccess ? 1 : 0 |
| | | },function(data){ |
| | | if(rv.IsSuccess){ |
| | | helper.ShowToast({ |
| | | "message" : "成功", |
| | | "type" : "success" |
| | | }); |
| | | helper.closeAgencyContact(component); |
| | | |
| | | // if (record_id && !isClone){ |
| | | |
| | | // helper.closeAgencyContact(component); |
| | | // //$A.get('e.force:refreshView').fire(); |
| | | // }else{ |
| | | // var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | // sObjectEvent.setParams({ |
| | | // "recordId": sfId |
| | | // }) |
| | | // sObjectEvent.fire(); |
| | | // } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | },staticResource.token); |
| | | |
| | | |
| | | }else{ |
| | | |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | })(); |
| | | |
| | | }, staticResource.token); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | } |
| | | }); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // helper.AwsPost(urlV2, [payloadPi], function(result){ |
| | | |
| | | // let obj = result.object[0]; |
| | | // let data = {}; |
| | | // if(record_id && !isClone){ |
| | | // data.Id = record_id; |
| | | // }else{ |
| | | // data.AWS_Data_Id__c = obj.dataId; |
| | | // } |
| | | // for(let s of layout){ |
| | | // for(let c of s.layoutColumns){ |
| | | // for(let item of c.layoutItems){ |
| | | // if(item.field && item.behavior != "Readonly"){ |
| | | // if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | // data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c]; |
| | | // data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c]; |
| | | // }else{ |
| | | // data[item.field] = item.value; |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // $A.getCallback(function(){ |
| | | // helper.CallBackAction(component,'Save',{ |
| | | // data : data, |
| | | // transId : result.txId |
| | | // },function(data){ |
| | | // component.set("v.showSpinner", false); |
| | | // if(data.getState() == "SUCCESS"){ |
| | | // var rv = data.getReturnValue(); |
| | | // console.log(rv); |
| | | // var sfId = null; |
| | | // if(rv.IsSuccess){ |
| | | // sfId = rv.Data.recordId; |
| | | // } |
| | | |
| | | // helper.AwsPost(staticResource.transactionUrl,{ |
| | | // txId: result.txId, |
| | | // sfRecordId:sfId, |
| | | // isSuccess: rv.IsSuccess ? 1 : 0 |
| | | // },function(data){ |
| | | // if(rv.IsSuccess){ |
| | | // helper.ShowToast({ |
| | | // "message" : "成功", |
| | | // "type" : "success" |
| | | // }); |
| | | // helper.closeAgencyContact(component); |
| | | |
| | | // // if (record_id && !isClone){ |
| | | |
| | | // // helper.closeAgencyContact(component); |
| | | // // //$A.get('e.force:refreshView').fire(); |
| | | // // }else{ |
| | | // // var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | // // sObjectEvent.setParams({ |
| | | // // "recordId": sfId |
| | | // // }) |
| | | // // sObjectEvent.fire(); |
| | | // // } |
| | | // }else{ |
| | | // helper.ShowToast({ |
| | | // "message" : rv.Message, |
| | | // "type" : "error" |
| | | // }); |
| | | // } |
| | | // },staticResource.token); |
| | | |
| | | |
| | | // }else{ |
| | | |
| | | // helper.ShowToast({ |
| | | // "message" : "Init error", |
| | | // "type" : "error" |
| | | // }); |
| | | |
| | | // } |
| | | // }); |
| | | // })(); |
| | | |
| | | // }, staticResource.token); |
| | | }, |
| | | cancelClick : function(component, event, helper){ |
| | | helper.closeAgencyContact(component); |
| | | }, |
| | | |
| | | scriptsLoaded : function(component, event, helper){} |
| | | }) |
| New file |
| | |
| | | ({ |
| | | CallBackAction : function(component,action_name,para,callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.","")); |
| | | if(para){ |
| | | action.setParams(para); |
| | | } |
| | | if(callback){ |
| | | action.setCallback(this,function(data){ |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | ShowToast : function(paras){ |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams(paras); |
| | | toastEvent.fire(); |
| | | }, |
| | | AwsPost : function(postURL, data ,callback,token){ |
| | | let payloadForNewPI = ''; |
| | | if(typeof(data) == 'string'){ |
| | | payloadForNewPI = data; |
| | | }else{ |
| | | payloadForNewPI = JSON.stringify(data); |
| | | } |
| | | |
| | | AWSService.post(postURL,payloadForNewPI,function(result) { |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | },token); |
| | | }, |
| | | AwsGet : function(url, data ,callback,token){ |
| | | |
| | | if(typeof(data) == 'string'){ |
| | | url += data; |
| | | }else{ |
| | | let i = 0; |
| | | for(let p in data){ |
| | | url += (i++) ? '&' : '?'; |
| | | url += p + '=' + data[p]; |
| | | } |
| | | } |
| | | |
| | | AWSService.get(url,function(result){ |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | },token); |
| | | }, |
| | | closeAgencyContact : function(component){ |
| | | var cmpEvent = component.getEvent("NewAgencyContactEvent"); |
| | | cmpEvent.setParams({ |
| | | "showNewAgencyContact":false}); |
| | | cmpEvent.fire(); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:event type="APPLICATION" description="Event template"> |
| | | <aura:attribute name="showNewAgencyContact" type="Boolean" default="false"/> |
| | | </aura:event> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <description>A Lightning Event Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 07-08-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global" |
| | | controller="NewAgencyOpportunityController"> |
| | | |
| | | <aura:attribute name = "recordId" type = "Id" default = ""/> |
| | | <aura:attribute name = "recordTypeId" type = "Id" default = ""/> |
| | | <aura:attribute name="ac_name" type="string"/> |
| | | <aura:attribute name="title" type="string"/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper"/> |
| | | <aura:attribute name="record_data" type="Map"/> |
| | | <aura:attribute name="section_names" type="List"/> |
| | | <aura:attribute name="showSpinner" type="Boolean" default = "False"/> |
| | | <aura:attribute name="showSpinner2" type="Boolean" default = "False"/> |
| | | <aura:attribute name="staticResource" type="Map"/> |
| | | <aura:attribute name="pi_fields_map" type="Map"/> |
| | | <aura:attribute name="isClone" type="Boolean" default = "False"/> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <aura:attribute name="isModalOpen" type="boolean" default="false"/> |
| | | <aura:attribute name="searchKeyWord" type="string" default=""/> |
| | | <aura:attribute name="contactAWSIds" type="List"/> |
| | | <aura:attribute name="login" type="Boolean" default="false"/> |
| | | <aura:attribute name="show" type="Boolean" default="false"/> |
| | | <aura:attribute name="showNewAgencyContact" type="Boolean" default="false"/> |
| | | <aura:handler name="NewAgencyContactEvent" event="c:NewAgencyContactEvent" action="{!c.closeAgencyContact}"/> |
| | | |
| | | |
| | | |
| | | <div class="{! v.container_class}"> |
| | | <!-- header --> |
| | | <header class="slds-modal__header"> |
| | | <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate"> |
| | | {!v.title} |
| | | </h2> |
| | | </header> |
| | | |
| | | <div class="slds-modal__content slds-p-around_medium"> |
| | | <aura:if isTrue="{!v.showSpinner}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" /> |
| | | </aura:if> |
| | | |
| | | |
| | | <lightning:recordEditForm objectApiName="Agency_Opportunity__c"> |
| | | |
| | | <lightning:accordion activeSectionName="{! v.section_names }" allowMultipleSectionsOpen="true" class="greyyyy" > |
| | | <aura:iteration items="{!v.layout}" var="section"> |
| | | <aura:if isTrue="{! section.editHeading }"> |
| | | <lightning:accordionSection name="{! section.label }" label="经销商询价信息"> |
| | | |
| | | <aura:iteration items="{! section.layoutColumns}" var="col"> |
| | | <aura:iteration items="{! col.layoutItems}" var="field"> |
| | | <aura:if isTrue="{! and(field.behavior != 'Readonly', field.field != 'Agency_Contact__c')}"> |
| | | <lightning:inputField required="{! field.behavior == 'Required' }" aura:id="field" fieldName="{! field.field}" value="{! field.value}" /> |
| | | |
| | | </aura:if> |
| | | <aura:if isTrue="{! field.field == 'Agency_Contact__c' }"> |
| | | <lightning:layout> |
| | | <lightning:layoutItem size="12"> |
| | | <lightning:input required="{! field.behavior == 'Required' }" label="客户人员" value = "{! field.value}" variant = "label-inline" style="margin-left: 0cm; display: none;" onclick="{! c.openModel }"/> |
| | | <lightning:input required="{! field.behavior == 'Required' }" label="客户人员" value = "{! v.ac_name}" variant = "label-inline" style="margin-left: 0cm; " onclick="{! c.openModel }"/> |
| | | </lightning:layoutItem> |
| | | <!-- <lightning:layoutItem size="1"> |
| | | <lightning:buttonIcon iconName="utility:settings" variant="container" alternativeText="Settings" title="Settings" class = "name" /> |
| | | </lightning:layoutItem> --> |
| | | </lightning:layout> |
| | | </aura:if> |
| | | </aura:iteration> |
| | | |
| | | </aura:iteration> |
| | | |
| | | </lightning:accordionSection> |
| | | </aura:if> |
| | | </aura:iteration> |
| | | </lightning:accordion> |
| | | </lightning:recordEditForm> |
| | | |
| | | <div style="text-align:center;margin: 5px;"> |
| | | <lightning:button class="slds-button slds-button_neutral" label="取消" onclick="{! c.cancelClick }" /> |
| | | <lightning:button class="slds-button slds-button_brand" variant="brand" label="保存" onclick="{! c.saveClick }" /> |
| | | </div> |
| | | </div> |
| | | <aura:if isTrue="{!v.isModalOpen}"> |
| | | |
| | | <!-- Modal/Popup Box starts here--> |
| | | <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" |
| | | aria-modal="true" aria-describedby="modal-content-id-1" |
| | | class="slds-modal slds-fade-in-open" > |
| | | |
| | | |
| | | |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | <span id="aa" class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | |
| | | |
| | | |
| | | <div class="slds-modal__container"> |
| | | <!-- Modal/Popup Box Header Starts here--> |
| | | <header class="slds-modal__header"> |
| | | <lightning:buttonIcon iconName="utility:close" |
| | | onclick="{! c.closeModel }" |
| | | alternativeText="close" |
| | | variant="bare-inverse" |
| | | class="slds-modal__close"/> |
| | | <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate"> |
| | | 搜索客户人员 |
| | | </h2> |
| | | </header> |
| | | |
| | | <!--Modal Body Start here--> |
| | | <div class="slds-modal__content slds-p-around_medium modal-body" id="modal-content-id-1"> |
| | | <lightning:layout> |
| | | <lightning:layoutItem size="7"> |
| | | <ui:inputText label="请输入客户姓名" class="field" value="{!v.searchKeyWord}"/> |
| | | </lightning:layoutItem> |
| | | <lightning:layoutItem size="2" class = "searchButton"> |
| | | <ui:button aura:id="button" buttonTitle="Click to see agency contact" class="button" label="搜索" press="{!c.searchAgencyContact}" disabled="false"/> |
| | | </lightning:layoutItem> |
| | | <lightning:layoutItem size="3" class = "searchButton"> |
| | | <ui:button aura:id="newAgencyContact" buttonTitle="Click to see agency contact" class="newAgencyContact" label="新建.客户人员" disabled="false" press="{!c.showNewAgency}"/> |
| | | </lightning:layoutItem> |
| | | </lightning:layout> |
| | | <div id="QueryResult" style = "margin-top:20px;"> |
| | | </div> |
| | | </div> |
| | | |
| | | <aura:if isTrue="{!v.showNewAgencyContact}"> |
| | | <section role="dialog" tabindex="-1" aria-modal="true" aria-labelledby="modal-heading-01" class="slds-modal slds-fade-in-open" aura:id="NewAgencyContact" id="NewAgencyContact"> |
| | | <c:NewAgencyContact2 /> |
| | | </section> |
| | | </aura:if> |
| | | |
| | | </div> |
| | | |
| | | </section> |
| | | <div class="slds-backdrop slds-backdrop_open"></div> |
| | | |
| | | |
| | | </aura:if> |
| | | |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS { |
| | | } |
| | | |
| | | .THIS .name{ |
| | | margin-right:0.5cm; |
| | | } |
| | | |
| | | .THIS .wh{ |
| | | width: 670px; |
| | | height: 500px; |
| | | } |
| | | |
| | | .THIS .slds-modal__container{ |
| | | max-width:70rem !important; |
| | | width:90% !important; |
| | | } |
| | | |
| | | .THIS .modal-body{ |
| | | height : 500px !important; |
| | | max-height: 500px !important; |
| | | } |
| | | |
| | | .THIS table{ |
| | | border-collapse: collapse; |
| | | border-spacing: 0; |
| | | width: 98%; |
| | | margin-left: 5px; |
| | | border: 1px solid #000000; |
| | | text-align: center; |
| | | } |
| | | .THIS tr{ |
| | | border: 1px solid #000000; |
| | | text-align: center; |
| | | } |
| | | .THIS td{ |
| | | border: 1px solid #000000; |
| | | text-align: center; |
| | | } |
| | | |
| | | .THIS th{ |
| | | border: 1px solid #000000; |
| | | text-align: center; |
| | | } |
| | | |
| | | .THIS.backgroundInverse { |
| | | position: relative; |
| | | background-color: #16325c; |
| | | height: 80px; |
| | | } |
| | | |
| | | .THIS.exampleHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | margin-left: 15px; |
| | | width: 55px; |
| | | vertical-align: middle; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .THIS .searchButton{ |
| | | margin-top:20px; |
| | | margin-left:20px; |
| | | } |
| New file |
| | |
| | | ({ |
| | | |
| | | doInit : function(component, event, helper) { |
| | | let rid = component.get('v.recordId'); |
| | | let pid = null; |
| | | if(!rid){ |
| | | pid = window.location.href.replace("https://","").split("/")[4]; |
| | | } |
| | | |
| | | let record_type_id = ''; |
| | | let pageref = component.get("v.pageReference") |
| | | if(!record_type_id && pageref){ |
| | | record_type_id = pageref.state.recordTypeId ? pageref.state.recordTypeId : ''; |
| | | } |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | if(!rid || isClone){ |
| | | component.set('v.title',$A.get("$Label.c.New")+'经销商询价'); |
| | | component.set("v.recordTypeId", record_type_id); |
| | | }else{ |
| | | component.set('v.title',$A.get("$Label.c.Edit")+'经销商询价'); |
| | | } |
| | | console.log('rid: ' + rid); |
| | | console.log('pid: ' + pid); |
| | | console.log('record_type_id: ' + record_type_id); |
| | | component.set("v.showSpinner", true); |
| | | helper.CallBackAction(component,'Init',{ |
| | | rid : rid, |
| | | pid : pid, |
| | | //rid : component.get('v.recordId'), |
| | | record_type_id : record_type_id |
| | | },function(data){ |
| | | |
| | | |
| | | console.log('data: ' + data); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | if(rv.IsSuccess){ |
| | | debugger |
| | | let layout = JSON.parse(rv.Data.layout); |
| | | let fields = rv.Data.fields; |
| | | let staticResource = JSON.parse(rv.Data.staticResource) |
| | | let section_names = []; |
| | | // let awsData = rv.Data.awsDataIds; |
| | | section_names = layout.map(s=>s.label); |
| | | component.set('v.section_names',section_names); |
| | | |
| | | let m = {}; |
| | | for(let f of staticResource.PIDetails){ |
| | | m[f.SF_Field_API_Name__c] = f; |
| | | } |
| | | component.set('v.pi_fields_map',m); |
| | | |
| | | |
| | | |
| | | if(rv.Data && rv.Data.data ){ |
| | | console.log('rv.Data.data = ' + rv.Data.data); |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(rv.Data.data.hasOwnProperty(item.field)){ |
| | | item.value = rv.Data.data[item.field]; |
| | | } |
| | | |
| | | if(fields.hasOwnProperty(item.field)){ |
| | | item.fi = fields[item.field]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | component.set('v.layout',layout); |
| | | component.set('v.record_data',rv.Data.data); |
| | | |
| | | if(rv.Data.data.Agency_Contact__r){ |
| | | if (rv.Data.data.Agency_Contact__r.AWS_Data_Id__c) { |
| | | helper.AwsGet(staticResource.queryUrl, { |
| | | dataId : rv.Data.data.Agency_Contact__r.AWS_Data_Id__c |
| | | }, function(data){ |
| | | console.log('data = ' + data); |
| | | if (data.object) { |
| | | component.set('v.ac_name',data.object.name); |
| | | } |
| | | }, staticResource.token); |
| | | } |
| | | } |
| | | |
| | | |
| | | // }, staticResource.token); |
| | | }else{ |
| | | |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(rv.Data && fields.hasOwnProperty(item.field) && fields[item.field].References && fields[item.field].References.map(m=>m.value).indexOf(rv.Data.pidType) > -1){ |
| | | item.value = pid; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | component.set('v.layout',layout); |
| | | } |
| | | |
| | | |
| | | component.set('v.fields',fields); |
| | | component.set('v.staticResource',staticResource); |
| | | component.set("v.showSpinner", false); |
| | | }else{ |
| | | component.set("v.showSpinner", false); |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | |
| | | }else{ |
| | | component.set("v.showSpinner", false); |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | saveClick : function(component, event, helper){ |
| | | |
| | | let staticResource = component.get('v.staticResource'); |
| | | let record_id = component.get('v.recordId'); |
| | | let record_type_id = component.get('v.recordTypeId'); |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | let url = staticResource.newUrl; |
| | | let payloadPi = {}; |
| | | if (record_id && !isClone) { |
| | | url = staticResource.updateUrl |
| | | payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c; |
| | | } |
| | | let layout = component.get('v.layout'); |
| | | |
| | | let pi_fields_map = component.get('v.pi_fields_map'); |
| | | |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | |
| | | payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = item.value; |
| | | } |
| | | |
| | | if (item.behavior == "Required" && !item.value ) { |
| | | let fs = component.find("field"); |
| | | for(let fi in fs){ |
| | | let f = fs[fi]; |
| | | if(!f.get('v.value')){ |
| | | f.reset(); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | component.set("v.showSpinner", true); |
| | | debugger |
| | | let data = {}; |
| | | if(record_id && !isClone){ |
| | | data.Id = record_id; |
| | | } |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field && item.behavior != "Readonly"){ |
| | | data[item.field] = item.value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | let x = 1; |
| | | helper.CallBackAction(component,'Save',{ |
| | | data : data, |
| | | transId :'1', |
| | | recordTypeId:record_type_id |
| | | },function(data){ |
| | | component.set("v.showSpinner", false); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | var sfId = null; |
| | | if(rv.IsSuccess){ |
| | | sfId = rv.Data.recordId; |
| | | helper.ShowToast({ |
| | | "message" : "成功", |
| | | "type" : "success" |
| | | }); |
| | | if (record_id){ |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | $A.get('e.force:refreshView').fire(); |
| | | }else{ |
| | | var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | sObjectEvent.setParams({ |
| | | "recordId": sfId |
| | | }) |
| | | sObjectEvent.fire(); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | cancelClick : function(component, event, helper){ |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | //component.set("v.showNewAgencyContact", false); |
| | | }, |
| | | searchAgencyContact : function(component, event, helper){ |
| | | component.find('button').set('v.disabled', true); |
| | | helper.resetTable(); |
| | | helper.preparePayloadForSearchAgencyContact(component, event, helper); |
| | | }, |
| | | initContactTable : function(component, event, helper){ |
| | | let cols = ['Name','AgencyHospital', 'DoctorDivision1','Type']; |
| | | let contactInfoList = []; |
| | | let awsDataIds = []; |
| | | let data = component.get('v.result'); |
| | | if(data.object){ |
| | | for(var i=0;i<data.object.length;i++){ |
| | | if(data.object[i].dataId){ |
| | | let contactInfo = new Object(); |
| | | //需要修改 |
| | | contactInfo.Name = data.object[i].name; |
| | | contactInfo.DoctorDivision1 = data.object[i].doctorDivision1; |
| | | contactInfo.AWSDataId = data.object[i].dataId; |
| | | contactInfo.Type = data.object[i].type; |
| | | contactInfo.pi = true; |
| | | awsDataIds.push(contactInfo.AWSDataId); |
| | | contactInfo.sfRecordId = ''; |
| | | contactInfoList.push(contactInfo); |
| | | } |
| | | } |
| | | } |
| | | let AWSIdToSFIdMapValue = {}; |
| | | }, |
| | | openModel: function(component, event, helper) { |
| | | let layout = component.get('v.layout'); |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field == 'Agency_Hospital__c' && !item.value){ |
| | | console.log('item.value = ' + item.value) |
| | | helper.ShowToast({ |
| | | "message" : "请先选择经销商医院", |
| | | "type" : "warning" |
| | | }); |
| | | return |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // Set isModalOpen true |
| | | component.set("v.isModalOpen", true); |
| | | component.find('button').set('v.disabled', true); |
| | | helper.preparePayloadForSearchAgencyContact(component, event, helper); |
| | | }, |
| | | |
| | | closeModel: function(component, event, helper) { |
| | | // Set isModalOpen false |
| | | component.set("v.isModalOpen", false); |
| | | }, |
| | | |
| | | saveDetails: function(component, event, helper) { |
| | | //do something |
| | | component.set("v.isModalOpen", false); |
| | | }, |
| | | |
| | | showNewAgency: function(component, event, helper) { |
| | | //do something |
| | | component.set("v.showNewAgencyContact", true); |
| | | }, |
| | | closeAgencyContact: function(component, event, helper) { |
| | | var message = event.getParam("showNewAgencyContact"); |
| | | component.set("v.showNewAgencyContact", message); |
| | | component.find('button').set('v.disabled', true); |
| | | helper.resetTable(); |
| | | helper.preparePayloadForSearchAgencyContact(component, event, helper); |
| | | }, |
| | | }) |
| New file |
| | |
| | | ({ |
| | | CallBackAction : function(component,action_name,para,callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.","")); |
| | | if(para){ |
| | | action.setParams(para); |
| | | } |
| | | if(callback){ |
| | | action.setCallback(this,function(data){ |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | ShowToast : function(paras){ |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams(paras); |
| | | toastEvent.fire(); |
| | | }, |
| | | AwsPost : function(postURL, data ,callback,token){ |
| | | let payloadForNewPI = ''; |
| | | if(typeof(data) == 'string'){ |
| | | payloadForNewPI = data; |
| | | }else{ |
| | | payloadForNewPI = JSON.stringify(data); |
| | | } |
| | | |
| | | AWSService.post(postURL,payloadForNewPI,function(result) { |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | },token); |
| | | }, |
| | | AwsGet : function(url, data ,callback,token){ |
| | | |
| | | if(typeof(data) == 'string'){ |
| | | url += data; |
| | | }else{ |
| | | let i = 0; |
| | | for(let p in data){ |
| | | url += (i++) ? '&' : '?'; |
| | | url += p + '=' + data[p]; |
| | | } |
| | | } |
| | | |
| | | AWSService.get(url,function(result){ |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | },token); |
| | | }, |
| | | refreshTable : function(component, event, helper,cols,contactInfoList,contactsInfo){ |
| | | let that = this; |
| | | let myTableDiv = document.getElementById("QueryResult"); |
| | | let table = document.createElement('TABLE'); |
| | | table.border = '1'; |
| | | table.id = 'table' |
| | | let tableBody = document.createElement('TBODY'); |
| | | table.appendChild(tableBody); |
| | | let headerTR = document.createElement('TR'); |
| | | let colsHeader = ['姓名','医院', '医生区分(职务)','分类']; |
| | | tableBody.appendChild(headerTR); |
| | | for (let i = 0; i < colsHeader.length; i++) { |
| | | let td = document.createElement('TH'); |
| | | td.width = '75'; |
| | | td.appendChild(document.createTextNode(colsHeader[i])); |
| | | headerTR.appendChild(td); |
| | | } |
| | | //3. Init the AWS data |
| | | for (let i = 0; i < contactInfoList.length; i++) { |
| | | let tr = document.createElement('TR'); |
| | | tableBody.appendChild(tr); |
| | | let contactInfoTemp = contactInfoList[i] |
| | | for (let j = 0; j < cols.length; j++) { |
| | | let td = document.createElement('TD'); |
| | | td.width = '75'; |
| | | if(contactInfoTemp.pi){ |
| | | if (!contactsInfo.hasOwnProperty(contactInfoTemp.AWSDataId)) { |
| | | continue; |
| | | } |
| | | if(j == 0 && contactsInfo[contactInfoTemp.AWSDataId] ){ |
| | | td.id = contactsInfo[contactInfoTemp.AWSDataId].Id; |
| | | } |
| | | }else{ |
| | | td.id = contactInfoTemp.sfRecordId; |
| | | } |
| | | td.appendChild(document.createTextNode(contactInfoTemp[cols[j]]!=null?contactInfoTemp[cols[j]]:'')); |
| | | if (cols[j] == 'Name') { |
| | | td.addEventListener("click", function (obj) { |
| | | that.redirectToParentPage(component, event, helper,obj); |
| | | }); |
| | | } |
| | | tr.appendChild(td); |
| | | } |
| | | } |
| | | myTableDiv.appendChild(table); |
| | | component.find('button').set('v.disabled', false); |
| | | }, |
| | | redirectToParentPage : function(component, event, helper,obj){ |
| | | let agencyContactName = obj.currentTarget.innerText; |
| | | let id = obj.currentTarget.id; |
| | | component.set('v.ac_name',agencyContactName); |
| | | let layout = component.get('v.layout'); |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field == 'Agency_Contact__c'){ |
| | | item.value = id; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | component.set("v.isModalOpen", false); |
| | | }, |
| | | resetTable : function(){ |
| | | let queryResult = document.getElementById('QueryResult'); |
| | | let table = document.getElementsByTagName('table'); |
| | | if(table.length > 1){ |
| | | for(var i=1;i<table.length;i++){ |
| | | queryResult.removeChild(table[i]) |
| | | } |
| | | } |
| | | }, |
| | | preparePayloadForSearchAgencyContact : function(component, event, helper){ |
| | | let that = this; |
| | | let agencyHospitalId = ''; |
| | | let accountId = ''; |
| | | let layout = component.get('v.layout'); |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | agencyHospitalId = item.value; |
| | | } |
| | | if(item.field == 'Account_Opp__c'){ |
| | | accountId = item.value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var action = component.get('c.getAWSDataIds'); |
| | | action.setParams({ |
| | | "agencyHospitalId" : agencyHospitalId, |
| | | "accountId" : accountId |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var rv = response.getReturnValue(); |
| | | if(rv.Data.length == 0){ |
| | | component.find('button').set('v.disabled', false); |
| | | helper.ShowToast({ |
| | | "message" : "该经销商医院下面没有客户人员", |
| | | "type" : "warning" |
| | | }); |
| | | return |
| | | } |
| | | let searchPayload = new Object(); |
| | | let searchAgencyContactName = component.get('v.searchKeyWord'); |
| | | searchPayload.dataIds = rv.Data; |
| | | searchPayload.name = searchAgencyContactName; |
| | | component.set('v.contactAWSIds',rv.Data); |
| | | let staticResource = component.get('v.staticResource'); |
| | | let url = staticResource.searchUrl; |
| | | let token = staticResource.token; |
| | | this.AwsPost(url,searchPayload,function(data){ |
| | | if(data.success){ |
| | | let cols = ['Name','AgencyHospital', 'DoctorDivision1','Type']; |
| | | let contactInfoList = []; |
| | | let awsDataIds = []; |
| | | if(data.object.length == 0){ |
| | | component.find('button').set('v.disabled', false); |
| | | that.ShowToast({ |
| | | "message" : '没有查询到该客户人员', |
| | | "type" : "warning" |
| | | }); |
| | | return |
| | | } |
| | | for(var i=0;i<data.object.length;i++){ |
| | | if(data.object[i].dataId){ |
| | | let contactInfo = new Object(); |
| | | //需要修改 |
| | | contactInfo.Name = data.object[i].name; |
| | | contactInfo.AgencyHospital = ''; |
| | | contactInfo.DoctorDivision1 = data.object[i].doctorDivision1; |
| | | contactInfo.AWSDataId = data.object[i].dataId; |
| | | contactInfo.Type = data.object[i].type; |
| | | contactInfo.pi = true; |
| | | awsDataIds.push(contactInfo.AWSDataId); |
| | | contactInfo.sfRecordId = ''; |
| | | contactInfoList.push(contactInfo); |
| | | } |
| | | } |
| | | //let AWSIdToSFIdMapValue = {}; |
| | | var searchAgencyContacts = component.get('c.searchAgencyContacts'); |
| | | searchAgencyContacts.setParams({ |
| | | "awsAgencyContactIds" : JSON.stringify(awsDataIds), |
| | | "agencyHospitalId" : agencyHospitalId, |
| | | "accountId" : accountId |
| | | }); |
| | | searchAgencyContacts.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var rv = response.getReturnValue(); |
| | | if(rv.IsSuccess){ |
| | | let contactsInfo = ''; |
| | | if(rv.Data){ |
| | | contactsInfo = JSON.parse(rv.Data.replace(/("\;)/g,"\"")); |
| | | if(Object.keys(contactsInfo).length>0){ |
| | | for(let i=0;i<contactInfoList.length;i++){ |
| | | let contactFromSF = contactsInfo[contactInfoList[i]['AWSDataId']]; |
| | | if(contactFromSF){ |
| | | contactInfoList[i].sfRecordId = contactFromSF['Id']; |
| | | if(contactFromSF['Agency_Hospital__r']){ |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Agency_Hospital__r']['Name']; |
| | | } |
| | | if(contactFromSF['Department_Class__r']){ |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Department_Class__r']['Parent']['Name']; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | that.refreshTable(component, event, helper,cols,contactInfoList,contactsInfo); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(searchAgencyContacts); |
| | | } |
| | | },token); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <aura:component controller="RetrospectiveWeeklyReportController" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global"> |
| | | <ltng:require styles="{!$Resource.multilineToastCSS}" /> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <aura:handler event="c:strike_evt" action="{!c.createAopp}" name="strike_evt_addNewRecord" /> |
| | | <aura:attribute name="data" type="Agency_Report__c" default="{sobjectType:'Agency_Report__c'}" /> |
| | | <aura:attribute name="oppdata" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}" /> |
| | | <aura:attribute name="acondata" type="Agency_Contact__c" default="{sobjectType:'Ag |
| | | ency_Contact__c'}" /> |
| | | <aura:attribute name="successMessage" type="String" /> |
| | | <aura:attribute name="etEng" type="String" /> |
| | | <aura:attribute name="errorMessage" type="String" /> |
| | | <aura:attribute name="Close_Forecasted_Date__c_o" type="Date" /> |
| | | <aura:attribute name="Amount__c_o" type="String" /> |
| | | <aura:attribute name="OCMSale_Price__c_o" type="String" /> |
| | | <aura:attribute name="StageName__c_o" type="String" /> |
| | | <aura:attribute name="fieldsmap" type="Map" /> |
| | | <aura:attribute name="AgencyReportMap" type="Boolean" default="false" /> |
| | | <!-- 日报分类 --> |
| | | |
| | | <aura:attribute name="alldata" type="List" /> |
| | | <aura:attribute name="setdoctorlisthos" type="Boolean" default="false" /> |
| | | <aura:attribute name="allselectlist" type="Map" /> |
| | | <aura:attribute name="doclist" type="List" /> |
| | | <aura:attribute name="docmap" type="Map" /> |
| | | <aura:attribute name="login" type="Boolean" default="false" /> |
| | | <aura:attribute name="loadOpp" type="Boolean" default="false" /> |
| | | <aura:attribute name="reportPageData" type="Map" /> |
| | | <aura:attribute name="selectbody" type="String" /> |
| | | <aura:attribute name="report_date_list" type="Map" /> |
| | | <aura:attribute name="selected_date" type="String" /> |
| | | <aura:attribute name="selected_agency_person" type="String" /> |
| | | <aura:attribute name="agency_report_header" type="String" /> |
| | | <aura:attribute name="agency_report_header_id" type="String" /> |
| | | <aura:attribute name="result" type="String" default="" /> |
| | | <!-- //医院 点选需要 --> |
| | | <aura:attribute name="hospital" type="string" default="" /> |
| | | <aura:attribute name="hospitalId" type="string" default="" /> |
| | | <aura:attribute name="hospitals" type="string" default="" /> |
| | | <aura:attribute name="hospitalLinkId" type="string" default="" /> |
| | | <aura:handler name="change" value="{!v.hospital}" action="{!c.hosChange}" /> |
| | | <aura:attribute name="hospitalList" type="Map" /> |
| | | <!-- 使用产品1(产品型号) --> |
| | | <aura:attribute name="UseProduct1" type="string" default="" /> |
| | | <aura:attribute name="UseProduct1s" type="string" default="" /> |
| | | <aura:handler name="change" value="{!v.UseProduct1}" action="{!c.UseProduct1Change}" /> |
| | | <aura:attribute name="UseProduct1List" type="Map" /> |
| | | <aura:attribute name="UseProduct1Id" type="string" default="" /> |
| | | <!-- 使用产品2 --> |
| | | <aura:attribute name="UseProduct2" type="string" default="" /> |
| | | <aura:attribute name="UseProduct2s" type="string" default="" /> |
| | | <aura:handler name="change" value="{!v.UseProduct2}" action="{!c.UseProduct2Change}" /> |
| | | <aura:attribute name="UseProduct2List" type="Map" /> |
| | | <aura:attribute name="UseProduct2Id" type="string" default="" /> |
| | | <!-- 使用产品3 --> |
| | | <aura:attribute name="UseProduct3" type="string" default="" /> |
| | | <aura:attribute name="UseProduct3s" type="string" default="" /> |
| | | <aura:handler name="change" value="{!v.UseProduct3}" action="{!c.UseProduct3Change}" /> |
| | | <aura:attribute name="UseProduct3List" type="Map" /> |
| | | <aura:attribute name="UseProduct3Id" type="string" default="" /> |
| | | <!--SWAG-CF58C3 fy start --> |
| | | <aura:attribute name="AWStoken" type="String"/> |
| | | <aura:attribute name="AWSsearch" type="String"/> |
| | | <aura:attribute name="AWSinsert" type="String"/> |
| | | <aura:attribute name="AWStransactionURL" type="String"/> |
| | | <aura:attribute name="AWSDoctor2Map" type="String"/> |
| | | <aura:attribute name="awsurl" type="Map"/> |
| | | <aura:attribute name="contactawsurl" type="Map"/> |
| | | <aura:attribute name="allselectlistAgencyPerson" type="Map"/> |
| | | <!--SWAG-CF58C3 fy end --> |
| | | |
| | | |
| | | <aura:attribute name="doctor_list" type="Map" /> |
| | | <!-- <aura:attribute name="doctor_title" type="String" /> --> |
| | | <aura:attribute name="opportunity_list" type="Map" /> |
| | | <aura:attribute name="edit_copy_select_report_id" type="String" /> |
| | | <aura:attribute name="create_agency_report_id" type="String" /> |
| | | <aura:attribute name="reports" type="List" /> |
| | | <aura:attribute name="reports_now" type="List" /> |
| | | <aura:attribute name="reports_now_count" type="Integer" /> |
| | | <aura:attribute name="mode" type="String" /> |
| | | <aura:attribute name="select_report_data" type="Map" /> |
| | | <aura:attribute name="select_report_data_radio" type="Map" /> |
| | | <aura:attribute name="default_select_doctor_id" type="String" /> |
| | | <aura:attribute name="default_select_doctor_id2" type="String" /> |
| | | <aura:attribute name="default_select_opportunity_id" type="String" /> |
| | | <aura:attribute name="report_count" type="Integer" /> |
| | | <aura:attribute name="dialog_type" type="String" /> |
| | | <aura:attribute name="truthy" type="Boolean" default="false" /> |
| | | <aura:attribute name="list_message" type="String" default="搜索" /> |
| | | <aura:attribute name="confirm_status" type="Integer" default="0" /> |
| | | <aura:attribute name="modal_confirm_title" type="String" /> |
| | | <aura:attribute name="modal_confirm_text" type="String" /> |
| | | <!-- <aura:attribute name="new_falg" type="String" /> --> |
| | | <!-- fy --> |
| | | <aura:attribute name="UserProType" type="String" /> |
| | | <!-- 科室 --> |
| | | <aura:attribute name="opportunity_cfilter" type="String" /> |
| | | <aura:attribute name="update_select_report_data_id" type="String" default="" /> |
| | | <!-- 批量添加日报 start--> |
| | | <aura:attribute name="reports_date" type="List" /> |
| | | <aura:attribute name="TableContent" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TableContent2" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TargetFileName" type="String" description="Name of the file" /> |
| | | <aura:attribute name="tableheaders" type="Object[]" /> |
| | | <aura:attribute name="fileContentData" type="String" /> |
| | | <aura:attribute name="filename" type="String" /> |
| | | <aura:attribute name="NumOfRecords" type="Integer" default="1000" /> |
| | | <aura:attribute name="showMain" type="Boolean" default="true" /> |
| | | <aura:attribute name="IsEventDefault" type="Boolean" default="true" /> |
| | | |
| | | <aura:attribute name="PIConfig" type="Map"/> |
| | | |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | |
| | | <!-- 批量添加日报 end--> |
| | | <!--ロード中...--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | <div id="auraErrorMessage"></div> |
| | | <div aura:id="report" id="report" class="contents_wrapper"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div style="width: 200px;"></div> |
| | | <div |
| | | class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"> |
| | | 周 |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <ui:inputSelect aura:id="select_date" class="slds-select" change="{!c.select_date_change}" /> |
| | | </div> |
| | | <!-- 代理店担当者 --> |
| | | <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12" |
| | | style="display: none;"> |
| | | {!v.fieldsmap.Person_In_Charge2__c} |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12" |
| | | style="display: none;"> |
| | | <ui:inputSelect aura:id="select_agency_person" class="slds-select agency_person_select" |
| | | change="{!c.select_agency_change}" /> |
| | | </div> |
| | | <div style="width: 100px;"> |
| | | </div> |
| | | <div class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12" |
| | | style="display: contents;"> |
| | | <ui:button aura:id="new_button" label="新建" press="{!c.new_report}" /> |
| | | </div> |
| | | <div style="width: 350px;" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | <ui:button aura:id="copy_button" label="复制" press="{!c.copy_button}" disabled="true" /> |
| | | <ui:button aura:id="delete_button" label="删除" press="{!c.delete_button}" disabled="true"/> |
| | | <ui:button aura:id="import" label="导入" press="{!c.import}" /> |
| | | <ui:button aura:id="export" label="导出" press="{!c.export_condition}" /> |
| | | <ui:button aura:id="returnbutton" label="返回" press="{!c.return_main_page}" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="report_list" class="report_list_area"> |
| | | <div class="slds-table--edit_container slds-is-relative" style="padding-left: 50px;"> |
| | | <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" |
| | | role="grid" style="width:66.75rem;"> |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Person_In_Charge2__c}</span> |
| | | <!-- {!v.fieldsmap.Person_In_Charge2__c} 担当--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | <!-- {!v.fieldsmap.Department_Cateogy__c} 科室--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">拜访人</span> |
| | | <!-- {!v.fieldsmap.doctor2__c} 拜访人 --> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.DealerPersonnel__c}</span> |
| | | <!-- {!v.fieldsmap.visitor_title__c} 职位--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.WorkMark__c}</span> |
| | | <!-- {!v.fieldsmap.visitor_title__c} 职位--> |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <aura:iteration items="{!v.reports}" var="item" indexVar="index"> |
| | | <tr class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <ui:inputRadio class="report_radio" name="report_radio" label="{!item.Name}" |
| | | change="{!c.change_report_radio}" /> |
| | | <lightning:buttonIcon class="edit_button" iconName="utility:edit" size="small" |
| | | alternativeText="edit" value="{!index}" onclick="{!c.edit_button}" /> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Person_In_Charge2__r.Name}">{!item.Person_In_Charge2__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <th scope="row" tabindex="0" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | {!item.Agency_Hospital__r.Name} |
| | | </span> |
| | | </th> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}">{!item.Department_Cateogy_text__c}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}"> |
| | | <span class="encrypt">{!item.doctor2__r.Name}</span> |
| | | <span class="decrypt">{!item.doctor2__r.awsdata.name}</span> |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.DealerPersonnel__r.Name}">{!item.DealerPersonnel__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit" > |
| | | <span class="slds-grid slds-grid--align-spread" > |
| | | <span class="slds-truncate" |
| | | title="{!item.WorkMark__c}" > |
| | | <lightning:input type="checkbox" checked="{!item.WorkMark__c}" disabled="true"/> |
| | | </span> |
| | | </span> |
| | | </td> |
| | | </tr> |
| | | </aura:iteration> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | <aura:renderIf isTrue="{!v.report_count > 0}"> |
| | | <aura:set attribute="else"> |
| | | <div class="no_data_area"> |
| | | {!v.list_message} |
| | | </div> |
| | | </aura:set> |
| | | </aura:renderIf> |
| | | </div> |
| | | <!-- 批量添加日报 start--> |
| | | <div aura:id="modal_import" role="dialog" tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_success" role="alert"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="Success" iconName="utility:success" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.successMessage}</h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv01" style="z-index: 10001"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_error" role="status"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="error" iconName="utility:error" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small " >{!v.errorMessage}</h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="slds-modal__container "> |
| | | <div class="slds-modal__header "> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">日报批量导入</h2> |
| | | <ui:button aura:id="close_button" label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_import}" /> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium "> |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div> |
| | | <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" /> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}" /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="保存" variant="brand" onclick="{!c.processFileContent}" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.cancel}" /> |
| | | </div> |
| | | |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_importbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <!-- 批量添加日报 end--> |
| | | |
| | | <!-- 批量导出日报 start--> |
| | | <div aura:id="modal_export" role="dialog" tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">日报批量导出</h2> |
| | | <ui:button aura:id="close_button" label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_export}" /> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"> |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | 活动日开始日期 |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " |
| | | aura:id="input-report-date1" /> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | 活动日结束日期 |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " |
| | | aura:id="input-report-date2" /> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.select_repores_date}" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.close_export}" /> |
| | | </div> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent2}" /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.exportDate}" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.close_export}" /> |
| | | </div> |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_exportbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <!-- 批量导出日报 end--> |
| | | <div aura:id="modal_window" role="dialog" tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_success" role="alert"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="Success" iconName="utility:success" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.successMessage}</h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_error" role="status"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="error" iconName="utility:error" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left">{!v.dialog_type}</h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 日报({!v.selected_date} {!v.selected_agency_person})</h2> |
| | | <ui:button aura:id="close_button" label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.toggle_report}" /> |
| | | </div> |
| | | <div class="slds-modal__content slds-grow slds-p-around--medium"> |
| | | <div class="slds-box slds-theme--shade"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | 活动日 |
| | | <lightning:input type="date" value="{!v.data.Report_Date__c}" aura:id="input-report-date" /> |
| | | </div> |
| | | <!-- 医院 --> |
| | | <div aura:id="hospital_list" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | data-select="single"> |
| | | <!-- label="医院" --> |
| | | 医院 |
| | | <lightning:input aura:id="hospital_input_text" class="field" |
| | | value="{!v.hospital}" updateOn="keyup" /> |
| | | <div class="slds-lookup__menu" id="lookup-66"> |
| | | <ul class="slds-lookup__list" role="listbox"> |
| | | <aura:iteration var="hospital" items="{!v.hospitalList}"> |
| | | <li role="presentation" onclick="{!c.selectHos}" |
| | | data-accName="{!hospital.Hospital_Name_readonly__c}" |
| | | data-accId="{!hospital.Hospital__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | {!hospital.Hospital_Name_readonly__c}</div> |
| | | </div> |
| | | </span> |
| | | </li> |
| | | </aura:iteration> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <!-- 科室分类 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.Department_Cateogy__c} |
| | | <ui:inputText aura:id="select_department" class="slds-select" |
| | | change="{!c.select_department}" /> |
| | | </div> |
| | | <!-- 经销商人员 change="{!c.select_DealerPersonnel}" --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" style="width: 145px;"> |
| | | {!v.fieldsmap.DealerPersonnel__c} |
| | | <ui:inputSelect aura:id="select_DealerPersonnel" class="slds-select" /> |
| | | </div> |
| | | <!-- 活动区分 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.WorkRecord__c} |
| | | <ui:inputSelect aura:id="select_purpose_type" class="slds-select" |
| | | change="{!c.select_purpose_type}" /> |
| | | </div> |
| | | <!-- 拜访人 {!v.fieldsmap.doctor2__c}--> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" style="width: 145px;"> |
| | | 拜访人 |
| | | <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}" /> |
| | | </div> |
| | | <!-- <p hidden="hidden"> --> |
| | | |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-12"> |
| | | <br /> |
| | | <ui:button label="新建" class="slds-button" press="{!c.createCon}" disabled="true" |
| | | aura:id="new_con" /> |
| | | </div> |
| | | |
| | | <!-- </p> --> |
| | | <hr /> |
| | | <!-- 产品分类(第三分类) change="{!c.select_ProductClassification}" --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | 产品分类(第三分类) |
| | | <ui:inputSelect aura:id="select_ProductClassification" class="slds-select" |
| | | change="{!c.selectProductClassification}" /> |
| | | </div> |
| | | <!-- 使用产品1(产品型号) UseProduct1__c --> |
| | | <div aura:id="UseProduct1_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | data-select="single"> |
| | | <!-- label="使用产品1(产品型号)" --> |
| | | 使用产品1(产品型号) |
| | | <lightning:input aura:id="UseProduct1_TEXT" class="field" |
| | | value="{!v.UseProduct1}" updateOn="keyup" /> |
| | | <div class="slds-lookup__menu" id="lookup-11"> |
| | | <ul class="slds-lookup__list" role="listbox" style="max-height:230px;"> |
| | | <aura:iteration var="UseProduct1" items="{!v.UseProduct1List}"> |
| | | <li role="presentation" onclick="{!c.seletUseProduct1Change}" |
| | | data-accid="{!UseProduct1.Id}" data-accName="{!UseProduct1.Asset_Model_No__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text">{!UseProduct1.Asset_Model_No__c}</div> |
| | | </div> |
| | | </span> |
| | | </li> |
| | | </aura:iteration> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <!-- 使用产品2 UseProduct2__c --> |
| | | <div aura:id="UseProduct2_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | data-select="single"> |
| | | <!-- label="使用产品2" --> |
| | | 使用产品2 |
| | | <lightning:input aura:id="UseProduct2_TEXT" class="field" |
| | | value="{!v.UseProduct2}" updateOn="keyup" /> |
| | | <div class="slds-lookup__menu" id="lookup-22"> |
| | | <ul class="slds-lookup__list" role="listbox" style="max-height:230px;"> |
| | | <aura:iteration var="UseProduct2" items="{!v.UseProduct2List}"> |
| | | <li role="presentation" onclick="{!c.seletUseProduct2Change}" |
| | | data-accid="{!UseProduct2.Id}" data-accName="{!UseProduct2.Asset_Model_No__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text">{!UseProduct2.Asset_Model_No__c}</div> |
| | | </div> |
| | | </span> |
| | | </li> |
| | | </aura:iteration> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <!-- 使用产品3 UseProduct3__c --> |
| | | <div aura:id="UseProduct3_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6" |
| | | data-select="single"> |
| | | <!-- label="使用产品3" --> |
| | | 使用产品3 |
| | | <lightning:input aura:id="UseProduct3_TEXT" class="field" |
| | | value="{!v.UseProduct3}" updateOn="keyup" /> |
| | | <div class="slds-lookup__menu" id="lookup-33"> |
| | | <ul class="slds-lookup__list" role="listbox" style="max-height:230px;"> |
| | | <aura:iteration var="UseProduct3" items="{!v.UseProduct3List}"> |
| | | <li role="presentation" onclick="{!c.seletUseProduct3Change}" |
| | | data-accid="{!UseProduct3.Id}" data-accName="{!UseProduct3.Asset_Model_No__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text">{!UseProduct3.Asset_Model_No__c}</div> |
| | | </div> |
| | | </span> |
| | | </li> |
| | | </aura:iteration> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <!-- 效果/进度 EffectProgress__c--> |
| | | <div aura:id="product_category_select1" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.EffectProgress__c} |
| | | <ui:inputSelect aura:id="select_EffectProgress" class="slds-select" /> |
| | | </div> |
| | | <hr /> |
| | | <!-- 产品1同类耗材科室月使用量 ConsumptionOfConsumables__c--> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.ConsumptionOfConsumables__c} |
| | | <ui:inputText aura:id="select_ConsumptionOfConsumables" class="slds-select" |
| | | change="{!c.select_ConsumptionOfConsumables}" /> |
| | | </div> |
| | | <!-- 术士分类 WarlockClassification__c --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.WarlockClassification__c} |
| | | <ui:inputSelect aura:id="select_OtherBrandConsumables" class="slds-select" /> |
| | | </div> |
| | | <!-- 已采用其他品牌 ProductCcategory__c --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.ProductCcategory__c} |
| | | <ui:inputSelect aura:id="select_ProductCcategory" class="slds-select" |
| | | change="{!c.selectpurposetype}" /> |
| | | </div> |
| | | <!-- 其他品牌产品类别 --> |
| | | <div aura:id="result" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.productCategories__c} |
| | | <ui:inputSelect aura:id="select_productCategories" class="slds-select" /> |
| | | </div> |
| | | <!-- 产品用量 warlocksNumber__c --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.warlocksNumber__c} |
| | | <ui:inputText aura:id="select_warlocksNumber" class="slds-select" |
| | | change="{!c.select_warlocksNumber}" /> |
| | | </div> |
| | | <!-- 支援需求 WorkMark__c--> |
| | | <div style="padding-left: 20px;"> |
| | | {!v.fieldsmap.WorkMark__c} |
| | | <lightning:input type="checkbox" aura:id="select_WorkMark" /> |
| | | </div> |
| | | <div aura:id="input-opportunity-stage" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.StageName__c} |
| | | <ui:inputSelect aura:id="select_stageName" class="slds-select" /> |
| | | </div> |
| | | <div aura:id="input-opportunity-amount1" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.Amount__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 医院采购预算(不含税,元)--> |
| | | <lightning:inputField value="{!v.oppdata.Amount__c}" class="" /> |
| | | |
| | | </div> |
| | | <div aura:id="input-opportunity-amount2" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.OCMSale_Price__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 订货金额(不含税,元) --> |
| | | <lightning:inputField value="{!v.oppdata.OCMSale_Price__c}" class="" /> |
| | | </div> |
| | | <div aura:id="input-opportunity-date" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.Close_Forecasted_Date__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 预测与OCSM签约日 --> |
| | | <lightning:inputField value="{!v.oppdata.Close_Forecasted_Date__c}" class="" /> |
| | | </div> |
| | | <hr /> |
| | | </div> |
| | | </div> |
| | | <div class="save_button_area"> |
| | | <ui:button aura:id="save_button" label="保存并新建" |
| | | class="save_button slds-button slds-button--brand slds-order--3" press="{!c.save_report}" /> |
| | | </div> |
| | | <aura:renderIf isTrue="{!v.reports_now_count > 0}"> |
| | | <div class="mt40 slds-box slds-theme--shade"> |
| | | <div class="slds-table--edit_container slds-is-relative"> |
| | | <table |
| | | class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" |
| | | role="grid"> |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name"></span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" |
| | | title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__c}</span> |
| | | <!-- 客户人员 --> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" |
| | | title="Name">{!v.fieldsmap.visitor_title__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.WorkRecord__c}</span> |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <aura:iteration items="{!v.reports_now}" var="item" indexVar="index"> |
| | | <tr aura:id="modal_data_list_tr" class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}">{!item.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Agency_Hospital__r.Name}">{!item.Agency_Hospital__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}">{!item.Department_Cateogy_text__c}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}">{!item.doctor2__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.visitor_title__c}">{!item.visitor_title__c}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.WorkRecord__c}">{!item.WorkRecord__c}</span> |
| | | </span> |
| | | </td> |
| | | </tr> |
| | | </aura:iteration> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | |
| | | <div aura:id="modal_confirm" role="dialog" tabindex="-2" aria-labelledby="header43" |
| | | class="disp_none slds-modal slds-fade-in-open"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="header43" class="slds-text-heading--medium">{!v.modal_confirm_title}</h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <p>{!v.modal_confirm_text}</p> |
| | | </div> |
| | | <div class="slds-modal__footer"> |
| | | <ui:button label="是" class="slds-button slds-button--brand" press="{!c.yes_button}" /> |
| | | <ui:button label="否" class="slds-button slds-button--neutral" press="{!c.no_button}" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_confirm_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | |
| | | <div aura:id="modal_newAC" role="dialog" tabindex="-3" aria-labelledby="headertest" |
| | | class="disp_none slds-modal slds-fade-in-open"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="headertest" class="slds-text-heading--medium">新建.拜访人</h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Agency_Contact__c" |
| | | onsuccess="{!c.handleSuccess}" onload="{!c.showRequiredFields}" onsubmit="{!c.handleSubmit}"> |
| | | <lightning:messages aura:id="OppMessage" /> |
| | | <!-- onload="{!c.showRequiredFields}" --> |
| | | <aura:renderIf isTrue="{!v.truthy}"> |
| | | <lightning:inputField fieldName="Name" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Type__c" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Doctor_Division1__c" aura:id="newOpportunityField" /> |
| | | </aura:renderIf> |
| | | <br /> |
| | | <br /> |
| | | <br /> |
| | | <br /> |
| | | <br /> |
| | | <div class="save_button_area"> |
| | | <lightning:button class="slds-m-top_small" type="button" label="取消" |
| | | onclick="{!c.createCancel}" /> |
| | | <lightning:button class="slds-m-top_small" type="button" label="保存" |
| | | onclick="{!c.handleSubmit}" /> |
| | | </div> |
| | | </lightning:recordEditForm> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS .bcolor { |
| | | color: #333; |
| | | } |
| | | .THIS.height100vh { |
| | | height: 100vh; |
| | | } |
| | | .THIS.contents_wrapper { |
| | | padding-top: 50px; |
| | | } |
| | | .THIS .mt5 { |
| | | margin-top: 5px; |
| | | } |
| | | .THIS .mt40 { |
| | | margin-top: 40px; |
| | | } |
| | | .THIS .edit_button { |
| | | float: right; |
| | | margin: -1.5em 0.5em 0 0; |
| | | border: 0; |
| | | } |
| | | .THIS .no_data_area { |
| | | text-align: center; |
| | | margin: .5em 0; |
| | | } |
| | | .THIS.report_list_area { |
| | | margin: 40px 0 20px 100px; |
| | | height: 60vh; |
| | | overflow-y: scroll; |
| | | } |
| | | .THIS .report_radio { |
| | | float: left; |
| | | } |
| | | .THIS .table_header { |
| | | width: 9.4rem; |
| | | height: 2em; |
| | | } |
| | | .THIS.disp_none { |
| | | display: none; |
| | | } |
| | | .THIS .disp_none { |
| | | display: none; |
| | | } |
| | | .THIS .tr { |
| | | text-align: right; |
| | | } |
| | | .THIS .close_button { |
| | | float: right; |
| | | margin-top: -2em; |
| | | } |
| | | .THIS .close_icn svg { |
| | | fill: #fefefe; |
| | | } |
| | | .THIS .slds-progress__marker { |
| | | cursor: default; |
| | | } |
| | | .THIS .progress_0 { |
| | | width: 0%; |
| | | } |
| | | .THIS .progress_100 { |
| | | width: 100%; |
| | | } |
| | | .THIS .new_btn_area { |
| | | text-align: center; |
| | | margin-top: 22px; |
| | | } |
| | | .THIS .new_btn { |
| | | width: 100%; |
| | | } |
| | | .THIS .save_button_area { |
| | | margin: 1em 0; |
| | | text-align: right; |
| | | } |
| | | .THIS .save_button { |
| | | background-color: #ffa500; |
| | | border: 1px solid #ff8c00; |
| | | } |
| | | .THIS .report_data_header { |
| | | border-bottom: 2px solid #ccc; |
| | | } |
| | | .THIS .report_data_area { |
| | | border-bottom: 1px solid #ccc; |
| | | } |
| | | .THIS.fade { |
| | | transition: 5s opacity linear; |
| | | } |
| | | .THIS.animation_off { |
| | | opacity: 0; |
| | | } |
| | | .THIS.animation_on { |
| | | opacity: 1; |
| | | } |
| | | .THIS .fade { |
| | | transition: 5s opacity linear; |
| | | } |
| | | .THIS .animation_off { |
| | | opacity: 0; |
| | | } |
| | | .THIS .animation_on { |
| | | opacity: 1; |
| | | } |
| | | .THIS .divbotuser{ |
| | | width:fit-content; |
| | | } |
| | | |
| | | .THIS .toastMessage.forceActionsText{ |
| | | white-space : pre-line !important; |
| | | } |
| | | |
| | | .THIS .slds-file-selector__dropzone .slds-file-selector__text{ |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .slds-input:focus, .THIS .slds-input:active { |
| | | border-color: rgb(216, 221, 230); |
| | | box-shadow: none; |
| | | } |
| | | |
| | | .THIS .customRequired{ |
| | | font-weight: 400; |
| | | } |
| | | .THIS .customRequired:before{ |
| | | content: "*"; |
| | | margin: 0 0.125rem 0 0.125rem; |
| | | color: rgb(194, 57, 52); |
| | | float: left; |
| | | } |
| | | .THIS .none{ |
| | | display:none; |
| | | } |
| | | |
| | | .THIS tr .decrypt{ |
| | | display: none; |
| | | } |
| | | |
| | | .THIS tr:hover .decrypt{ |
| | | display: unset; |
| | | } |
| | | |
| | | .THIS tr:hover .encrypt{ |
| | | display: none; |
| | | } |
| New file |
| | |
| | | <design:component > |
| | | |
| | | </design:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" /> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" /> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | doInit : function(component, event, helper) { |
| | | helper.doinit(component, event, helper); |
| | | }, |
| | | |
| | | createAopp : function(component, event, helper) { |
| | | var addRecordEvent = $A.get('e.force:createRecord'); |
| | | addRecordEvent.setParams({ |
| | | entityApiName: 'Agency_Opportunity__c', |
| | | recordTypeId: '012100000006KW7' |
| | | }); |
| | | addRecordEvent.fire(); |
| | | }, |
| | | |
| | | new_report : function(component, event, helper) { |
| | | component.find('save_button').set('v.label', '保存并新建'); |
| | | helper.new_report(component, event, helper); |
| | | }, |
| | | |
| | | copy_button : function(component, event, helper) { |
| | | component.find('save_button').set('v.label', '保存并新建'); |
| | | helper.copy_button(component, event, helper); |
| | | }, |
| | | delete_button : function(component, event, helper) { |
| | | helper.delete_button(component, event, helper); |
| | | }, |
| | | change_report_radio : function(component, event, helper) { |
| | | helper.change_report_radio(component, event, helper); |
| | | }, |
| | | |
| | | edit_button : function(component, event, helper) { |
| | | component.find('save_button').set('v.label', '保存'); |
| | | helper.edit_button(component, event, helper); |
| | | }, |
| | | |
| | | createCon : function(component, event, helper) { |
| | | helper.createCon(component, event, helper); |
| | | }, |
| | | |
| | | showRequiredFields: function(component, event, helper){ |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | }, |
| | | |
| | | handleSuccess : function(component, event, helper) { |
| | | helper.handleSuccess(component, event, helper); |
| | | }, |
| | | |
| | | handleSubmit : function(component, event, helper) { |
| | | event.preventDefault(); // stop form submission |
| | | var showValidationError = false; |
| | | var fields = component.find("newOpportunityField"); |
| | | var vaildationFailReason = ''; |
| | | let agencyReport = Object.create(null); |
| | | fields.forEach(function (field) { |
| | | if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | showValidationError = true; |
| | | vaildationFailReason = "分类不能为空!"; |
| | | }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | showValidationError = true; |
| | | if(vaildationFailReason != ''){ |
| | | vaildationFailReason += "医生区分(职务)不能为空!"; |
| | | }else{ |
| | | vaildationFailReason = "医生区分(职务)不能为空!"; |
| | | } |
| | | |
| | | } |
| | | //SWAG-CF58C3 fy start |
| | | if(field.get("v.fieldName") === 'Name'){ |
| | | agencyReport['name'] = field.get("v.value"); |
| | | }else if(field.get("v.fieldName") === 'Type__c'){ |
| | | agencyReport['type'] = field.get("v.value"); |
| | | }else if(field.get("v.fieldName") === 'Doctor_Division1__c'){ |
| | | agencyReport['doctorDivision1'] = field.get("v.value"); |
| | | } |
| | | //SWAG-CF58C3 fy end |
| | | }); |
| | | if (!showValidationError) { |
| | | //SWAG-CF58C3 fy start |
| | | var agencyHospitalid = component.get('v.hospitalLinkId'); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | hospitalId : agencyHospitalid |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | }else{ |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | | var requestData = JSON.stringify(arr); |
| | | // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert') + 'V2'; |
| | | |
| | | component.set('v.login',true); |
| | | helper.insert_agencycontact(component,token,newUrl,requestData,agencyHospitalid,helper,hospitalName); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }) |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // var arr = new Array(); |
| | | // arr.push(agencyReport); |
| | | // var data = JSON.stringify(arr); |
| | | // var token = component.get('v.AWStoken'); |
| | | // var newUrl = component.get('v.AWSinsert'); |
| | | // component.set('v.login',true); |
| | | // helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper); |
| | | //SWAG-CF58C3 fy end |
| | | // helper.newlyBuild(component, event, helper); |
| | | }else{ |
| | | component.find('OppMessage').setError(vaildationFailReason); |
| | | } |
| | | }, |
| | | |
| | | createCancel : function(component, event, helper) { |
| | | helper.createCancel(component, event, helper); |
| | | }, |
| | | |
| | | yes_button : function(component, event, helper) { |
| | | component.set('v.confirm_status', 1); |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | }, |
| | | |
| | | no_button : function(component, event, helper) { |
| | | component.set('v.confirm_status', 2); |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | }, |
| | | |
| | | toggle_report : function(component, event, helper) { |
| | | helper.toggle_report(component, event, helper); |
| | | }, |
| | | |
| | | save_report : function(component, event, helper) { |
| | | helper.save_report(component, event, helper); |
| | | }, |
| | | |
| | | select_date_change : function(component, event, helper) { |
| | | helper.select_date_change(component, event, helper); |
| | | }, |
| | | |
| | | select_agency_change : function(component, event, helper) { |
| | | debugger |
| | | helper.select_agency_change(component, event, helper); |
| | | }, |
| | | |
| | | hosChange : function(component, event, helper) { |
| | | var hospital_name = event.getParam("value"); |
| | | var hospital_nameld = component.get("v.UseProduct1s"); |
| | | if (hospital_name.match(/(\S+\s)+/)) { |
| | | if(hospital_nameld!=hospital_name){ |
| | | helper.searchHos(component, event, helper); |
| | | } |
| | | } else { |
| | | if(hospital_name==''){ |
| | | helper.hideSearchs(component, event, helper); |
| | | }else{ |
| | | helper.hideSearch(component, event, helper); |
| | | } |
| | | } |
| | | }, |
| | | selectHos : function(component, event, helper) { |
| | | helper.selectHos(component, event, helper); |
| | | helper.setOpportunity_cfilter(component); |
| | | }, |
| | | //使用产品1 |
| | | UseProduct1Change : function(component, event, helper) { |
| | | var UseProduct1Name = event.getParam("value"); |
| | | var UseProduct1Nameold = component.get("v.UseProduct1s"); |
| | | debugger |
| | | if (UseProduct1Name.match(/(\S+\s)+/)) { |
| | | if(UseProduct1Name!=UseProduct1Nameold){ |
| | | helper.searchUseProduct1(component, event, helper); |
| | | } |
| | | } else { |
| | | if(UseProduct1Name==''){ |
| | | helper.hideSearchUseProduct1s(component, event, helper); |
| | | }else{ |
| | | helper.hideSearchUseProduct1(component, event, helper); |
| | | } |
| | | } |
| | | }, |
| | | seletUseProduct1Change : function(component, event, helper) { |
| | | helper.seletUseProduct1Change(component, event, helper); |
| | | }, |
| | | //使用产品2 |
| | | UseProduct2Change : function(component, event, helper) { |
| | | var UseProduct2Name = event.getParam("value"); |
| | | var UseProduct2Nameold = component.get("v.UseProduct2s"); |
| | | if (UseProduct2Name.match(/(\S+\s)+/)) { |
| | | if(UseProduct2Name!=UseProduct2Nameold){ |
| | | helper.searchUseProduct2(component, event, helper); |
| | | } |
| | | } else { |
| | | if(UseProduct2Name==''){ |
| | | helper.hideSearchUseProduct2s(component, event, helper); |
| | | }else{ |
| | | helper.hideSearchUseProduct2(component, event, helper); |
| | | } |
| | | } |
| | | }, |
| | | seletUseProduct2Change : function(component, event, helper) { |
| | | helper.seletUseProduct2Change(component, event, helper); |
| | | }, |
| | | productcategoryChange2 : function(component, event, helper) { |
| | | helper.productcategoryChange2(component, event, helper); |
| | | }, |
| | | //使用产品3 |
| | | UseProduct3Change : function(component, event, helper) { |
| | | var UseProduct3Name = event.getParam("value"); |
| | | var UseProduct3Nameold = component.get("v.UseProduct3s"); |
| | | if (UseProduct3Name.match(/(\S+\s)+/)) { |
| | | if(UseProduct3Name!=UseProduct3Nameold){ |
| | | helper.searchUseProduct3(component, event, helper); |
| | | } |
| | | } else { |
| | | if(UseProduct3Name==''){ |
| | | helper.hideSearchUseProduct3s(component, event, helper); |
| | | }else{ |
| | | helper.hideSearchUseProduct3(component, event, helper); |
| | | } |
| | | } |
| | | }, |
| | | seletUseProduct3Change : function(component, event, helper) { |
| | | helper.seletUseProduct3Change(component, event, helper); |
| | | }, |
| | | |
| | | |
| | | select_department : function(component, event, helper) { |
| | | helper.setOpportunity_cfilter(component); |
| | | }, |
| | | doctor_change : function(component, event, helper) { |
| | | helper.doctor_change(component, event, helper); |
| | | }, |
| | | stageNameChange : function(component, event, helper) { |
| | | helper.stageNameChange(component, event, helper); |
| | | }, |
| | | onDragOver : function(component, event, helper) { |
| | | event.preventDefault(); |
| | | }, |
| | | |
| | | onDrop : function(component, event, helper) { |
| | | event.stopPropagation(); |
| | | event.preventDefault(); |
| | | event.dataTransfer.dropEffect='copy'; |
| | | var files=event.dataTransfer.files; |
| | | helper.readFile(component,helper,files[0]); |
| | | }, |
| | | CreateRecord : function(component, event, helper){ |
| | | var files = event.getSource().get("v.files"); |
| | | helper.readFile(component,helper,files[0]); |
| | | }, |
| | | |
| | | processFileContent : function(component,event,helper){ |
| | | helper.saveRecords(component,event,helper); |
| | | }, |
| | | |
| | | cancel : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | }, |
| | | |
| | | import : function(component,event,helper){ |
| | | helper.showImport(component); |
| | | }, |
| | | exportDate : function(component,event,helper){ |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log('导出数据'+stockData); |
| | | var csv = helper.convertArrayOfObjectsToCSV(component,stockData); |
| | | if (csv == null){return;} |
| | | |
| | | var universalBOM = "\uFEFF"; |
| | | var hiddenElement = document.createElement('a'); |
| | | hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM+csv); |
| | | hiddenElement.target = '_self'; // |
| | | hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv] |
| | | document.body.appendChild(hiddenElement); // Required for FireFox browser |
| | | hiddenElement.click(); // using click() js function to download csv file |
| | | |
| | | }, |
| | | export_condition : function(component,event,helper){ |
| | | helper.showExport(component); |
| | | }, |
| | | |
| | | select_repores_date : function(component,event,helper){ |
| | | helper.select_repores_date(component,event,helper); |
| | | }, |
| | | export : function(component,event,helper){ |
| | | console.log('进入export'); |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log('查出的数据'+stockData); |
| | | }, |
| | | close_import : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | helper.close_import(component); |
| | | }, |
| | | close_export : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | helper.close_export(component); |
| | | }, |
| | | select_ConsumptionOfConsumables : function(component,event,helper){ |
| | | helper.select_ConsumptionOfConsumables(component,event,helper); |
| | | }, |
| | | select_purpose_type : function(component,event,helper){ |
| | | helper.selectPurposeType(component,event,helper); |
| | | }, |
| | | select_warlocksNumber : function(component,event,helper){ |
| | | helper.select_warlocksNumber(component,event,helper); |
| | | }, |
| | | selectProductClassification : function(component,event,helper){ |
| | | helper.selectProductClassification(component,event,helper); |
| | | }, |
| | | selectpurposetype : function(component,event,helper){ |
| | | helper.selectpurposetype(component,event,helper); |
| | | }, |
| | | return_main_page: function(component,event,helper){ |
| | | window.open('/customer/','_self'); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | doinit: function (component, event, helper) { |
| | | debugger |
| | | this.report_date_list(component, event, helper, 5); |
| | | component.set('v.login', true); |
| | | var action = component.get('c.getalldata'); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.set('v.alldata', res.reports); |
| | | component.set('v.fieldsmap', res.fieldsMap); |
| | | component.set('v.allselectlist', res.allselectlist); |
| | | component.set('v.doclist', res.doclist); |
| | | //fy |
| | | debugger |
| | | var xx=res.UserProType; |
| | | component.set('v.UserProType', res.UserProType); |
| | | var gg=component.get('v.UserProType'); |
| | | //fy |
| | | component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); |
| | | component.find('select_DealerPersonnel').set('v.options', this.conv_selected(res.allselectlist.DealerPersonnel__c)); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.WorkRecord__c)); |
| | | component.find('select_ProductClassification').set('v.options', this.conv_selected(res.allselectlist.ProductClassification__c)); |
| | | component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c)); |
| | | component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label); |
| | | component.set('v.dialog_type', '新建'); |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | |
| | | component.set('v.PIConfig', res.PIConfig);// 20220222 PI改造 by Bright |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'doinit failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | //其他品牌产品类别 下拉框赋值 |
| | | selectProductCcategory : function(component){ |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | if(select_ProductClassification != ''){ |
| | | var action = component.get('c.selectProductCcategory'); |
| | | action.setCallback(this,function( response){ |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.find('select_ProductCcategory').set('v.options', JSON.parse(JSON.stringify(res))); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }else{ |
| | | component.find('select_ProductCcategory').set('v.options', []); |
| | | } |
| | | }, |
| | | //根据周和担当查询数据给初始页面赋数据 |
| | | get_reports: function (component, event, helper, date_str, person_str) { |
| | | if (!date_str) { |
| | | return false; |
| | | } |
| | | |
| | | if(person_str){ |
| | | var person_str2= person_str.split(';'); |
| | | if(person_str2.length>1){ |
| | | person_str=person_str2[0]; |
| | | } |
| | | } |
| | | date_str = this.get_date_string(date_str); |
| | | var action = component.get('c.getReports'); |
| | | action.setParams({ |
| | | "date_str": date_str, |
| | | "person_str": person_str, |
| | | }); |
| | | component.set('v.login', true); |
| | | action.setCallback(this, function (response) { |
| | | debugger |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.set('v.reports', res.reports); |
| | | component.set('v.report_count', res.reports.length); |
| | | // 更新保存後のselect_data用 |
| | | var report_id = component.get('v.update_select_report_data_id'); |
| | | if (report_id != "") { |
| | | for (var i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]['Id'] == report_id) { |
| | | component.set('v.select_report_data', res.reports[i]); |
| | | break; |
| | | } |
| | | } |
| | | component.set('v.update_select_report_data_id', ''); |
| | | } |
| | | if (res.reports.length > 0) { |
| | | component.set('v.list_message', ''); |
| | | var flag2=res.reports.length; |
| | | //fy 20220414 start |
| | | var report1 =[]; |
| | | var report2 =[]; |
| | | res.reports.forEach(item => { |
| | | if((item.WorkRecord__c == '科室会'&&item.doctor3__c != undefined)|| |
| | | ((item.doctor3__c == undefined||item.doctor3__c == ''||item.doctor3__c=="") |
| | | && (item.doctor2__r== undefined||item.doctor2__r==''||item.doctor2__r==""))){ |
| | | report1.push(item); |
| | | }else{ |
| | | report2.push(item); |
| | | } |
| | | }); |
| | | res.reports=report2; |
| | | //fy 20220414 end |
| | | // PI 改造 By Bright 20220328 |
| | | if(true){ |
| | | let doctor_awsids = res.reports.map(function(d){return d.doctor2__r.AWS_Data_Id__c;}); |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | if(doctor_awsids.length > 0){ |
| | | AWSService.search(staticResourceAgencyContact.searchUrl,{ |
| | | dataIds:doctor_awsids |
| | | }, function(data){ |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | debugger |
| | | for(let ri in res.reports){ |
| | | if(res.reports[ri] && res.reports[ri].doctor2__r && res.reports[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res.reports[ri].doctor2__r.AWS_Data_Id__c)){ |
| | | res.reports[ri].doctor2__r.awsdata = m[res.reports[ri].doctor2__r.AWS_Data_Id__c]; |
| | | } |
| | | } |
| | | component.set('v.reports', res.reports); |
| | | component.set('v.report_count', res.reports.length); |
| | | } |
| | | //fy 20220414 start |
| | | var reports3=component.get('v.reports'); |
| | | if(reports3.length<flag2){ |
| | | res.reports = [...report1, ...reports3]; |
| | | component.set('v.reports', res.reports); |
| | | component.set('v.report_count', res.reports.length); |
| | | } |
| | | //fy 20220414 end |
| | | component.set('v.login', false); |
| | | }, staticResourceAgencyContact.token); |
| | | }else{ |
| | | component.set('v.login', false); |
| | | } |
| | | } |
| | | } else { |
| | | component.set('v.list_message', 'no_data'); |
| | | component.set('v.login', false); |
| | | } |
| | | |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'get_reports failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | //复制按钮变灰色 |
| | | select_date_change: function (component, event, helper) { |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | component.set('v.select_report_data_radio', ''); |
| | | component.find('copy_button').set('v.disabled', true); |
| | | component.find('delete_button').set('v.disabled', true); |
| | | }, |
| | | |
| | | select_agency_change: function (component, event, helper) { |
| | | var select_value = component.find('select_agency_person').get('v.value'); |
| | | var new_label = this.get_agency_person_name(component, select_value); |
| | | component.set('v.selected_agency_person', new_label); |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), select_value); |
| | | component.set('v.select_report_data_radio', ''); |
| | | component.find('copy_button').set('v.disabled', true); |
| | | component.find('delete_button').set('v.disabled', true); |
| | | }, |
| | | |
| | | get_agency_person_name: function (component, agency_person_value) { |
| | | var allselectlist = component.get('v.allselectlist.AgencyPerson__c'); |
| | | var new_label = ''; |
| | | for (var i = 0; i < allselectlist.length; i++) { |
| | | if (agency_person_value == allselectlist[i].value) { |
| | | new_label = allselectlist[i].label; |
| | | break; |
| | | } |
| | | } |
| | | return new_label; |
| | | }, |
| | | //复制和编辑回显的位置 |
| | | toggle_report: function (component) { |
| | | debugger |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | if ($A.util.hasClass(modal_window, 'disp_none')) { |
| | | // OPEN |
| | | $A.util.removeClass(modal_window, 'disp_none'); |
| | | $A.util.removeClass(modal_bg, 'disp_none'); |
| | | //复制 和编辑 回显问题在这里面 |
| | | if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') { |
| | | var select_data = ''; |
| | | if (component.get('v.mode') == 'edit') { |
| | | select_data = component.get('v.select_report_data'); |
| | | } else if (component.get('v.mode') == 'copy') { |
| | | select_data = component.get('v.select_report_data_radio'); |
| | | } |
| | | var reports = component.get('v.reports'); |
| | | var Agency_Hospital_text = ''; |
| | | var Agency_Hospital_parent_id = ''; |
| | | // 医院名 |
| | | if (select_data['Agency_Hospital__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) { |
| | | Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | } |
| | | } |
| | | component.set('v.hospital', Agency_Hospital_text); |
| | | component.set('v.hospitalId', Agency_Hospital_parent_id); |
| | | component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']); |
| | | component.find('new_con').set('v.disabled', false); |
| | | } |
| | | //使用产品1(产品型号) |
| | | var UseProduct1Text = ''; |
| | | var UseProduct1Id = ''; |
| | | if (select_data['UseProduct1__c'] != '' && select_data['UseProduct1__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct1__c'] == select_data['UseProduct1__c']) { |
| | | UseProduct1Text = reports[i]['UseProduct1__r']['Asset_Model_No__c']; |
| | | UseProduct1Id = reports[i]['UseProduct1__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct1', UseProduct1Text); |
| | | component.set('v.UseProduct1Id', select_data['UseProduct1__c']); |
| | | } |
| | | //使用产品2 |
| | | var UseProduct2Text = ''; |
| | | var UseProduct2Id = ''; |
| | | if (select_data['UseProduct2__c'] != ''&&select_data['UseProduct2__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct2__c'] == select_data['UseProduct2__c']) { |
| | | UseProduct2Text = reports[i]['UseProduct2__r']['Asset_Model_No__c']; |
| | | UseProduct2Id = reports[i]['UseProduct2__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct2', UseProduct2Text); |
| | | component.set('v.UseProduct2Id', select_data['UseProduct2__c']); |
| | | } |
| | | //使用产品3 |
| | | var UseProduct3Text = ''; |
| | | var UseProduct3Id = ''; |
| | | if (select_data['UseProduct3__c'] != ''&&select_data['UseProduct3__c'] != undefined) { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['UseProduct3__c'] == select_data['UseProduct3__c']) { |
| | | UseProduct3Text = reports[i]['UseProduct3__r']['Asset_Model_No__c']; |
| | | UseProduct3Id = reports[i]['UseProduct3__c']; |
| | | } |
| | | } |
| | | component.set('v.UseProduct3', UseProduct3Text); |
| | | component.set('v.UseProduct3Id', select_data['UseProduct3__c']); |
| | | } |
| | | //活动日 |
| | | var reportDate; |
| | | if (select_data['Report_Date__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i]['Report_Date__c'] == select_data['Report_Date__c']) { |
| | | reportDate = reports[i]["Report_Date__c"]; |
| | | } |
| | | } |
| | | component.set('v.data.Report_Date__c', reportDate); |
| | | } |
| | | // 科室 |
| | | // if (select_data['Department_Cateogy__c'] != '') { |
| | | // component.find('select_department').set('v.value',select_data['Department_Cateogy__c']); |
| | | // } |
| | | //fy Department_Cateogy_text__c |
| | | if (select_data['Department_Cateogy_text__c'] != '') { |
| | | component.find('select_department').set('v.value',select_data['Department_Cateogy_text__c']); |
| | | } |
| | | //经销商人员 |
| | | if (select_data['DealerPersonnel__c'] != '') { |
| | | this.set_selected(component, 'select_DealerPersonnel', select_data['DealerPersonnel__c']); |
| | | } |
| | | // 活动区分 |
| | | if (select_data['WorkRecord__c'] != '') { |
| | | this.set_selected(component, 'select_purpose_type', select_data['WorkRecord__c']); |
| | | this.selectPurposeType(component); |
| | | } |
| | | // 拜访人 |
| | | if(select_data['WorkRecord__c'] == '科室会'){ |
| | | component.set('v.default_select_doctor_id2', select_data['doctor3__c']); |
| | | var a =component.get('v.default_select_doctor_id2'); |
| | | this.set_doctor_list(component); |
| | | }else{ |
| | | component.set('v.default_select_doctor_id', select_data['doctor2__c']); |
| | | this.set_doctor_list(component); |
| | | } |
| | | //产品分类(第三分类) |
| | | if (select_data['ProductClassification__c'] != null) { |
| | | this.set_selected(component, 'select_ProductClassification', select_data['ProductClassification__c']); |
| | | this.selectProductClassification(component); |
| | | } |
| | | // 产品1同类耗材科室月使用量 |
| | | if (select_data['ConsumptionOfConsumables__c'] != '') { |
| | | component.find('select_ConsumptionOfConsumables').set('v.value',select_data['ConsumptionOfConsumables__c']); |
| | | } |
| | | // 产品用量 |
| | | if (select_data['warlocksNumber__c'] != '') { |
| | | component.find('select_warlocksNumber').set('v.value',select_data['warlocksNumber__c']); |
| | | } |
| | | // 支援需求 |
| | | if (select_data['WorkMark__c'] != false) { |
| | | component.find('select_WorkMark').set('v.checked',select_data['WorkMark__c']); |
| | | } |
| | | debugger; |
| | | |
| | | var report_id = component.get('v.edit_copy_select_report_id'); |
| | | if (report_id != "") { |
| | | var select_EffectProgress1 = ''; |
| | | var WarlockClassification = ''; |
| | | var ProductCcategory = ''; |
| | | var productCategories = ''; |
| | | var i = 0; |
| | | for (i = 0; i < reports.length; i++) { |
| | | if (report_id == reports[i]["Id"]) { |
| | | select_EffectProgress1 = reports[i]["EffectProgress__c"]; |
| | | WarlockClassification = reports[i]["WarlockClassification__c"]; |
| | | ProductCcategory = reports[i]["ProductCcategory__c"]; |
| | | productCategories = reports[i]["productCategories__c"]; |
| | | break; |
| | | } |
| | | } |
| | | //效果/进度 |
| | | if (select_EffectProgress1 != null && select_EffectProgress1 != '') { |
| | | component.find('select_EffectProgress').set('v.value', select_EffectProgress1); |
| | | } |
| | | //术士分类 |
| | | if (WarlockClassification != null && WarlockClassification != '') { |
| | | component.find('select_OtherBrandConsumables').set('v.value', WarlockClassification); |
| | | } |
| | | //已采用其他品牌 |
| | | if (ProductCcategory != null && ProductCcategory != '') { |
| | | component.find('select_ProductCcategory').set('v.value', ProductCcategory); |
| | | this.selectpurposetype(component); |
| | | } |
| | | //其他品牌产品类别 |
| | | if (productCategories != null && productCategories != '') { |
| | | component.find('select_productCategories').set('v.value', productCategories); |
| | | } |
| | | component.set('v.edit_copy_select_report_id', ""); |
| | | } |
| | | } |
| | | } else { |
| | | var select_report_data = component.get('v.select_report_data'); |
| | | var Report_Date__c = component.get('v.data.Report_Date__c'); |
| | | var Agency_Hospital__c = component.get('v.hospitalLinkId'); |
| | | var UseProduct1__c = component.get('v.UseProduct1Id'); |
| | | var UseProduct2__c = component.get('v.UseProduct2Id'); |
| | | var UseProduct3__c = component.get('v.UseProduct3Id'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value'); |
| | | var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value'); |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | var WorkRecord__c = component.find('select_purpose_type').get('v.value'); |
| | | var EffectProgress__c = component.find('select_EffectProgress').get('v.value'); |
| | | var WarlockClassification__c = component.find('select_OtherBrandConsumables').get('v.value'); |
| | | var ProductCcategory__c = component.find('select_ProductCcategory').get('v.value'); |
| | | var productCategories__c = component.find('select_productCategories').get('v.value'); |
| | | var warlocksNumber__c = component.find('select_warlocksNumber').get('v.value'); |
| | | var WorkMark__c = component.find('select_WorkMark').get('v.checked'); |
| | | if (component.get('v.mode') == 'new') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建日报?'; |
| | | if (!Report_Date__c && |
| | | !Agency_Hospital__c && |
| | | !UseProduct1__c && |
| | | !UseProduct2__c && |
| | | !UseProduct3__c && |
| | | !Department_Cateogy__c && |
| | | !ConsumptionOfConsumables__c && |
| | | !DealerPersonnel__c && |
| | | !doctor2__c && |
| | | !EffectProgress__c && |
| | | !WarlockClassification__c && |
| | | !ProductCcategory__c && |
| | | !productCategories__c && |
| | | !warlocksNumber__c && |
| | | !WorkMark__c && |
| | | !WorkRecord__c |
| | | ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'copy') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建日报?'; |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['UseProduct1__c'] == UseProduct1__c && |
| | | select_report_data['UseProduct2__c'] == UseProduct2__c && |
| | | select_report_data['UseProduct3__c'] == UseProduct3__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c && |
| | | select_report_data['DealerPersonnel__c'] == DealerPersonnel__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['EffectProgress__c'] == EffectProgress__c && |
| | | select_report_data['WarlockClassification__c'] == WarlockClassification__c && |
| | | select_report_data['ProductCcategory__c'] == ProductCcategory__c && |
| | | select_report_data['productCategories__c'] == productCategories__c && |
| | | select_report_data['warlocksNumber__c'] == warlocksNumber__c && |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'edit') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃编辑日报?'; |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['UseProduct1__c'] == UseProduct1__c && |
| | | select_report_data['UseProduct2__c'] == UseProduct2__c && |
| | | select_report_data['UseProduct3__c'] == UseProduct3__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['ConsumptionOfConsumables__c'] == ConsumptionOfConsumables__c && |
| | | select_report_data['DealerPersonnel__c'] == DealerPersonnel__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['EffectProgress__c'] == EffectProgress__c && |
| | | select_report_data['WarlockClassification__c'] == WarlockClassification__c && |
| | | select_report_data['ProductCcategory__c'] == ProductCcategory__c && |
| | | select_report_data['productCategories__c'] == productCategories__c && |
| | | select_report_data['warlocksNumber__c'] == warlocksNumber__c && |
| | | select_report_data['WorkMark__c'] == WorkMark__c && |
| | | select_report_data['WorkRecord__c'] == WorkRecord__c ) { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | //关闭页面是 小的提示框是否放弃新建日报 |
| | | close_confirm: function (component, title, text) { |
| | | var confirm_status = component.get('v.confirm_status'); |
| | | component.set('v.modal_confirm_title', title); |
| | | component.set('v.modal_confirm_text', text); |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | var modal_confirm = component.find('modal_confirm'); |
| | | var modal_confirm_bg = component.find('modal_confirm_bg'); |
| | | debugger |
| | | if (confirm_status == 0) { |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | $A.util.removeClass(modal_confirm, 'disp_none'); |
| | | $A.util.removeClass(modal_confirm_bg, 'disp_none'); |
| | | } else if (confirm_status == 1) { |
| | | // 是 |
| | | $A.util.addClass(modal_confirm, 'disp_none'); |
| | | $A.util.addClass(modal_confirm_bg, 'disp_none'); |
| | | component.set('v.mode', ''); |
| | | this.allclear(component); |
| | | component.set('v.reports_now', ""); |
| | | component.set('v.reports_now_count', 0); |
| | | component.set('v.confirm_status', 0); |
| | | } else if (confirm_status == 2) { |
| | | // 否 |
| | | $A.util.removeClass(modal_window, 'disp_none'); |
| | | $A.util.removeClass(modal_bg, 'disp_none'); |
| | | $A.util.addClass(modal_confirm, 'disp_none'); |
| | | $A.util.addClass(modal_confirm_bg, 'disp_none'); |
| | | component.set('v.confirm_status', 0); |
| | | } |
| | | }, |
| | | //新建按钮 |
| | | new_report: function (component, event, helper) { |
| | | |
| | | component.set('v.mode', 'new'); |
| | | component.set('v.dialog_type', '新建'); |
| | | // 周 |
| | | var select_date = component.find('select_date').get('v.value'); |
| | | // 担当 |
| | | var select_agency = component.find('select_agency_person').get('v.value'); |
| | | var cm = 0; |
| | | if(select_agency.indexOf(";") != -1){ |
| | | select_agency = select_agency.split(";")[0]; |
| | | } |
| | | component.set('v.selected_date', select_date); |
| | | // 担当 |
| | | var name = component.get('v.selected_agency_person'); |
| | | var ret = this.create_report_header(component, event, helper, name, select_agency, select_date); |
| | | component.set('v.default_select_doctor_id2', ''); |
| | | |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component,'Agency_Contact__c') |
| | | // SWAG-CF58C3 fy end |
| | | }, |
| | | // 复制按钮 |
| | | copy_button: function (component, event, helper) { |
| | | debugger |
| | | this.allclear(component); |
| | | component.set('v.mode', 'copy'); |
| | | component.set('v.dialog_type', '新建'); |
| | | var select_report_data = component.get('v.select_report_data_radio'); |
| | | component.set('v.loadOpp', true); |
| | | // 週 |
| | | var now = new Date(); |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1)); |
| | | var select_date = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(); |
| | | this.set_selected(component, 'select_date', select_date); |
| | | component.set('v.selected_date', select_date); |
| | | // 担当 |
| | | var select_agency = select_report_data['Person_In_Charge2__c']; |
| | | var new_label = this.get_agency_person_name(component, select_agency); |
| | | component.set('v.selected_agency_person', new_label); |
| | | this.set_selected(component, 'select_agency_person', select_agency); |
| | | var name = component.get('v.selected_agency_person'); |
| | | component.set('v.edit_copy_select_report_id', select_report_data['Id']); |
| | | component.set('v.select_report_data', select_report_data); |
| | | |
| | | var ret = this.create_report_header(component, event, helper, name, select_agency, select_date); |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component,'Agency_Contact__c') |
| | | // SWAG-CF58C3 fy end |
| | | |
| | | }, |
| | | //删除按钮 |
| | | delete_button: function (component, event, helper) { |
| | | debugger |
| | | var select_report_data = component.get('v.select_report_data_radio'); |
| | | if(confirm('是否删除该数据?')){ |
| | | debugger |
| | | component.set('v.login', true); |
| | | var action = component.get('c.deleteAgencyReport'); |
| | | action.setParams({ |
| | | "agencyReport_id": select_report_data.Id, |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var result = response.getReturnValue(); |
| | | if(result=='success'){ |
| | | this.select_agency_change(component, event, helper); |
| | | } |
| | | component.set('v.login', false); |
| | | }else { |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | }, |
| | | //复制按钮可用 |
| | | change_report_radio: function (component, event, helper) { |
| | | debugger |
| | | var reports = component.get('v.reports'); |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i].Name == event.getSource().get('v.label')) { |
| | | component.set('v.select_report_data_radio', reports[i]); |
| | | component.find('copy_button').set('v.disabled', false); |
| | | component.find('delete_button').set('v.disabled', false); |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | //编辑按钮 |
| | | edit_button: function (component, event, helper) { |
| | | this.allclear(component); |
| | | debugger |
| | | component.set('v.loadOpp', true); |
| | | var index = event.getSource().get('v.value'); |
| | | component.set('v.select_report_data', component.get('v.reports')[index]); |
| | | component.set('v.mode', 'edit'); |
| | | component.set('v.dialog_type', '编辑'); |
| | | var select_date = component.get('v.reports')[index].Submit_date__c; |
| | | var select_agency = component.get('v.reports')[index].Person_In_Charge2__c; |
| | | var text_tmp = select_date.split('-'); |
| | | var select_date_text = text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]); |
| | | component.set('v.selected_date', select_date_text); |
| | | var name = component.get('v.reports')[index].Person_In_Charge2__r.Name; |
| | | this.set_selected(component, 'select_agency_person', select_agency); |
| | | var new_label = this.get_agency_person_name(component, select_agency); |
| | | component.set('v.selected_agency_person', new_label); |
| | | component.set('v.edit_copy_select_report_id', component.get('v.reports')[index].Id); |
| | | var ret = this.create_report_header(component, event, helper, name, select_agency, select_date); |
| | | // SWAG-CF58C3 fy start |
| | | this.set_aws_url(component,'Agency_Contact__c') |
| | | // SWAG-CF58C3 fy end |
| | | }, |
| | | //保存 |
| | | save_report: function (component, event, helper) { |
| | | var UserProType = component.get('v.UserProType'); |
| | | component.find('save_button').set('v.disabled', true); |
| | | var etEng = component.get('v.etEng'); |
| | | var Report_Date__c = component.get('v.data.Report_Date__c'); |
| | | var Person_In_Charge2__c = ""; |
| | | var Submit_date__c = ""; |
| | | if (component.get('v.mode') == 'edit') { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = component.get('v.select_report_data').Submit_date__c; |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.get('v.select_report_data').Person_In_Charge2__c; |
| | | } else { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = this.get_date_string(component.find('select_date').get('v.value')); |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.find('select_agency_person').get('v.value'); |
| | | } |
| | | debugger |
| | | // Agency_Report_Header__c |
| | | var Agency_Report_Header__c = component.get('v.agency_report_header_id'); |
| | | // 医院 |
| | | var Agency_Hospital__c = component.get('v.hospitalLinkId'); |
| | | // 产品分类(第三分类) |
| | | var ProductClassification__c = component.find('select_ProductClassification').get('v.value'); |
| | | // 使用产品1(产品型号) UseProduct1__c |
| | | var UseProduct1__c = component.get('v.UseProduct1Id'); |
| | | // 使用产品2 UseProduct2__c |
| | | var UseProduct2__c = component.get('v.UseProduct2Id'); |
| | | // 使用产品3 UseProduct3__c |
| | | var UseProduct3__c = component.get('v.UseProduct3Id'); |
| | | // 科室 Department_Cateogy__c |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | // 经销商人员 DealerPersonnel__c |
| | | var DealerPersonnel__c = component.find('select_DealerPersonnel').get('v.value'); |
| | | // 拜访人 doctor2__c |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | // 活动区分会 WorkRecord__c |
| | | var WorkRecord__c = component.find('select_purpose_type').get('v.value'); |
| | | // 效果/进度 EffectProgress__c |
| | | var EffectProgress__c = component.find('select_EffectProgress').get('v.value'); |
| | | // alert(EffectProgress__c); |
| | | // 科室同来耗材月使用量 ConsumptionOfConsumables__c |
| | | var ConsumptionOfConsumables__c = component.find('select_ConsumptionOfConsumables').get('v.value'); |
| | | // 术士分类 WarlockClassification__c |
| | | var WarlockClassification__c = component.find('select_OtherBrandConsumables').get('v.value'); |
| | | // 已采用其他品牌 ProductCcategory__c |
| | | var ProductCcategory__c = component.find('select_ProductCcategory').get('v.value'); |
| | | // 其他品牌产品类别 productCategories__c |
| | | var productCategories__c = component.find('select_productCategories').get('v.value'); |
| | | // 产品用量 warlocksNumber__c |
| | | var warlocksNumber__c = component.find('select_warlocksNumber').get('v.value'); |
| | | // 支援需求 WorkMark__c |
| | | var WorkMark__c = component.find('select_WorkMark').get('v.checked'); |
| | | var StageName__c = component.find('select_stageName').get('v.value'); |
| | | var Amount__c = component.get('v.oppdata.Amount__c') != null ? component.get('v.oppdata.Amount__c').toString() : ''; |
| | | var OCMSale_Price__c = component.get('v.oppdata.OCMSale_Price__c') != null ? component.get('v.oppdata.OCMSale_Price__c').toString() : ''; |
| | | var Close_Forecasted_Date__c = component.get('v.oppdata.Close_Forecasted_Date__c'); |
| | | var StageName__c_o = component.get('v.StageName__c_o'); |
| | | var Amount__c_o = component.get('v.Amount__c_o'); |
| | | var OCMSale_Price__c_o = component.get('v.OCMSale_Price__c_o'); |
| | | var Close_Forecasted_Date__c_o = component.get('v.Close_Forecasted_Date__c_o'); |
| | | if (StageName__c_o == undefined) StageName__c_o = ''; |
| | | if (Amount__c_o == undefined) Amount__c_o = ''; |
| | | if (OCMSale_Price__c_o == undefined) OCMSale_Price__c_o = ''; |
| | | if (Close_Forecasted_Date__c_o == undefined) Close_Forecasted_Date__c_o = ''; |
| | | if (StageName__c == StageName__c_o && OCMSale_Price__c_o == OCMSale_Price__c && Amount__c == Amount__c_o && Close_Forecasted_Date__c == Close_Forecasted_Date__c_o) { |
| | | StageName__c = ''; |
| | | Amount__c = ''; |
| | | OCMSale_Price__c = ''; |
| | | Close_Forecasted_Date__c = ''; |
| | | } |
| | | // バリデーション |
| | | var error = []; |
| | | //fy start |
| | | // if(WorkRecord__c != 'SIS'&&WorkRecord__c != '科室会'){ |
| | | if(WorkRecord__c == '临床信息(使用量)收集'){ |
| | | if (warlocksNumber__c==''||warlocksNumber__c==""||warlocksNumber__c==undefined) { error.push("产品用量 不能为空"); } |
| | | } |
| | | //fy end |
| | | if(WorkRecord__c == '临床信息(使用量)收集'&&UserProType=='ENG'){ |
| | | if (productCategories__c==''||productCategories__c==""||productCategories__c==undefined) { error.push("其他品牌产品类别 不存在"); } |
| | | } |
| | | if(WorkRecord__c == '临床信息(使用量)收集'){ |
| | | if (ProductCcategory__c==''||ProductCcategory__c==""||ProductCcategory__c==undefined) { error.push("已采用其他品牌 不存在"); } |
| | | } |
| | | if(WorkRecord__c == '临床信息(使用量)收集'){ |
| | | if (WarlockClassification__c==''||WarlockClassification__c==""||WarlockClassification__c==undefined) { error.push("产品1对应术式分类 不存在"); } |
| | | } |
| | | if(WorkRecord__c == '临床信息(使用量)收集'){ |
| | | if (ConsumptionOfConsumables__c==''||ConsumptionOfConsumables__c==""||ConsumptionOfConsumables__c==undefined) { error.push("产品1同类耗材科室月使用量 不能为空"); } |
| | | } |
| | | if(WorkRecord__c != '临床信息(使用量)收集'&&WorkRecord__c != '市场推广类活动'){ |
| | | if (EffectProgress__c==''||EffectProgress__c==""||EffectProgress__c==undefined) { error.push("效果/进度 不存在"); } |
| | | } |
| | | // if(WorkRecord__c != '临床信息(使用量)收集'&&WorkRecord__c != 'QIS处理'){ |
| | | if(WorkRecord__c != '临床信息(使用量)收集'){ |
| | | if (UseProduct1__c==''||UseProduct1__c==""||UseProduct1__c==undefined) { error.push("使用产品1(产品型号) 不存在"); } |
| | | } |
| | | if (ProductClassification__c==''||ProductClassification__c==""||ProductClassification__c==undefined) { error.push("产品分类(第三分类) 不存在"); } |
| | | if(WorkRecord__c == 'SIS'||WorkRecord__c == '科室会'||WorkRecord__c == '院内入院申请'||WorkRecord__c == '收费项目申请'){ |
| | | if (doctor2__c==''||doctor2__c==""||doctor2__c==undefined) { error.push("拜访人 不存在"); } |
| | | } |
| | | if (WorkRecord__c==''||WorkRecord__c==""||WorkRecord__c==undefined) { error.push("活动区分 不存在"); } |
| | | if (DealerPersonnel__c==''||DealerPersonnel__c==""||DealerPersonnel__c==undefined) { error.push("经销商人员 不存在"); } |
| | | if (Department_Cateogy__c==''||Department_Cateogy__c==""||Department_Cateogy__c==undefined) { error.push("科室 不存在"); } |
| | | if (Agency_Hospital__c==''||Agency_Hospital__c==""||Agency_Hospital__c==undefined) { error.push("医院 不存在"); } |
| | | |
| | | |
| | | |
| | | |
| | | if (Report_Date__c==''||Report_Date__c==""||Report_Date__c==undefined) { error.push("活动日 不存在"); } |
| | | if (Submit_date__c==''||Submit_date__c==""||Submit_date__c==undefined) { error.push("周 不存在"); } |
| | | var rDate = new Date(Report_Date__c); |
| | | var sDate = new Date(Submit_date__c); |
| | | sDate.setDate(sDate.getDate() - 1); |
| | | if (rDate < sDate) { error.push('活动日必须是本周!'); } |
| | | sDate.setDate(sDate.getDate() + 7); |
| | | if (rDate >= sDate) { error.push('活动日必须是本周!'); } |
| | | if (Person_In_Charge2__c==''||Person_In_Charge2__c==""||Person_In_Charge2__c==undefined) { error.push("担当 不存在"); } |
| | | if (Agency_Report_Header__c==''||Agency_Report_Header__c==""||Agency_Report_Header__c==undefined) { this.error("Report Header Id 不存在"); } |
| | | |
| | | |
| | | // if (!UseProduct2__c) { error.push("使用产品2 不存在"); } |
| | | // if (!UseProduct3__c) { error.push("使用产品3 不存在"); } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // if (!productCategories__c) { error.push("其他品牌产品类别 不存在"); } |
| | | |
| | | for (var i = 0; i < error.length; i++) { |
| | | component.set('v.errorMessage', error[i]); |
| | | this.showErrorToast(component); |
| | | } |
| | | if (error.length > 0) { |
| | | component.find('save_button').set('v.disabled', false); |
| | | return false; |
| | | } |
| | | // 保存処理 |
| | | component.set('v.login', true); |
| | | if (component.get('v.mode') == 'edit') { |
| | | var Agency_Report__c = component.get('v.select_report_data').Id; |
| | | var action = component.get('c.editAgencyReport'); |
| | | action.setParams({ |
| | | "Agency_Report_Id": Agency_Report__c, |
| | | "Department_Cateogy": Department_Cateogy__c, |
| | | "ConsumptionOfConsumables": ConsumptionOfConsumables__c, |
| | | "WorkRecord": WorkRecord__c, |
| | | "EffectProgress": EffectProgress__c, |
| | | "WarlockClassification" : WarlockClassification__c, |
| | | "ProductCcategory" : ProductCcategory__c, |
| | | "productCategories" : productCategories__c, |
| | | "warlocksNumber" : warlocksNumber__c, |
| | | "WorkMark" : WorkMark__c, |
| | | "ProductClassification": ProductClassification__c, |
| | | "DealerPersonnel": DealerPersonnel__c, |
| | | "Agency_Report_Header": Agency_Report_Header__c, |
| | | "Agency_Hospital": Agency_Hospital__c, |
| | | "UseProduct1": UseProduct1__c, |
| | | "UseProduct2": UseProduct2__c, |
| | | "UseProduct3": UseProduct3__c, |
| | | "Person_In_Charge2": Person_In_Charge2__c, |
| | | "doctor": doctor2__c, |
| | | "Submit_date": Submit_date__c, |
| | | "StageName": StageName__c, |
| | | "oppAmount": Amount__c, |
| | | "oppOCMPrice": OCMSale_Price__c, |
| | | "Close_Forecasted_Date": Close_Forecasted_Date__c, |
| | | "Report_Date": Report_Date__c |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | component.set('v.successMessage', '编辑保存成功'); |
| | | this.showSuccessToast(component); |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | var select_agency_list = component.get('v.allselectlist').AgencyPerson__c; |
| | | for (var i = 0; i < select_agency_list.length; i++) { |
| | | if (select_agency_list[i].value == component.get('v.select_report_data').Person_In_Charge2__c) { |
| | | select_agency_list[i].selected = true; |
| | | } else { |
| | | select_agency_list[i].selected = false; |
| | | } |
| | | } |
| | | component.find('select_agency_person').set('v.options', select_agency_list); |
| | | component.set('v.update_select_report_data_id', report_id); |
| | | this.get_reports(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'save_report failed.'); |
| | | this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } else { |
| | | /* Save (New & Copy) */ |
| | | var action = component.get('c.saveAgencyReport'); |
| | | action.setParams({ |
| | | "Department_Cateogy": Department_Cateogy__c, |
| | | "ConsumptionOfConsumables": ConsumptionOfConsumables__c, |
| | | "WorkMark" : WorkMark__c, |
| | | "warlocksNumber" : warlocksNumber__c, |
| | | "DealerPersonnel": DealerPersonnel__c, |
| | | "ProductCcategory" : ProductCcategory__c, |
| | | "productCategories" : productCategories__c, |
| | | "WarlockClassification" : WarlockClassification__c, |
| | | "ProductClassification": ProductClassification__c, |
| | | "WorkRecord": WorkRecord__c, |
| | | "EffectProgress": EffectProgress__c, |
| | | "Agency_Report_Header": Agency_Report_Header__c, |
| | | "Agency_Hospital": Agency_Hospital__c, |
| | | "Person_In_Charge2": Person_In_Charge2__c, |
| | | "doctor": doctor2__c, |
| | | "Submit_date": Submit_date__c, |
| | | "UseProduct1": UseProduct1__c, |
| | | "UseProduct2": UseProduct2__c, |
| | | "UseProduct3": UseProduct3__c, |
| | | "StageName": StageName__c, |
| | | "oppAmount": Amount__c, |
| | | "oppOCMPrice": OCMSale_Price__c, |
| | | "Close_Forecasted_Date": Close_Forecasted_Date__c, |
| | | "Report_Date": Report_Date__c |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | component.set('v.successMessage', '保存成功'); |
| | | this.showSuccessToast(component); |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | // モーダルウィンドウ内の一覧用 |
| | | var action2 = component.get('c.getReportsById'); |
| | | action2.setParams({ |
| | | "report_id": report_id, |
| | | }); |
| | | action2.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | var reports_now = component.get('v.reports_now'); |
| | | var reports_now_count = 0; |
| | | if (reports_now.length > 0 && reports_now != "") { |
| | | reports_now_count = reports_now.length; |
| | | } |
| | | // Save&New時のウィンドウ内データ一覧 |
| | | if (res.length > 0) { |
| | | reports_now[reports_now_count] = res[0]; |
| | | reports_now.sort(function (a, b) { |
| | | if (a.Name > b.Name) return -1; |
| | | if (a.Name < b.Name) return 1; |
| | | return 0; |
| | | }); |
| | | component.set('v.reports_now', reports_now); |
| | | component.set('v.reports_now_count', reports_now.length); |
| | | var data_list = component.find('modal_data_list_tr'); |
| | | } |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'get_reports_now failed.'); |
| | | this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action2); |
| | | this.allclear(component); |
| | | component.find('select_WorkMark').set('v.value', false); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | this.doinit(component, event, helper); |
| | | } |
| | | else { |
| | | var error = response.getError(); |
| | | component.set('v.errorMessage', 'saveAgencyReport failed.'); |
| | | this.showErrorToast(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | }, |
| | | |
| | | allclear: function (component) { |
| | | var clear = [{ label: '', value: '', selected: true }]; |
| | | component.set('v.hospital', ''); |
| | | component.set('v.hospitalId', ''); |
| | | component.set('v.hospitalLinkId', ''); |
| | | component.set('v.UseProduct1', ''); |
| | | component.set('v.UseProduct1Id', ''); |
| | | component.set('v.UseProduct2', ''); |
| | | component.set('v.UseProduct2Id', ''); |
| | | component.set('v.UseProduct3', ''); |
| | | component.set('v.UseProduct3Id', ''); |
| | | component.find('select_ProductClassification').set('v.value', ''); |
| | | component.find('select_warlocksNumber').set('v.value', null); |
| | | component.find('select_department').set('v.value', ''); |
| | | component.find('select_ConsumptionOfConsumables').set('v.value', null); |
| | | component.find('select_WorkMark').set('v.checked', false); |
| | | component.find('new_con').set('v.disabled', true); |
| | | component.find('select_doctor').set('v.options', clear); |
| | | component.find('select_DealerPersonnel').set('v.options', this.conv_selected(component.get('v.allselectlist.DealerPersonnel__c'))); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.WorkRecord__c'))); |
| | | // component.find('select_ProductCcategory').set('v.options', this.conv_selected(component.get('v.allselectlist.ProductCcategory__c'))); |
| | | component.find('select_EffectProgress').set('v.value', ''); |
| | | component.find('select_OtherBrandConsumables').set('v.value', ''); |
| | | component.find('select_ProductCcategory').set('v.value', ''); |
| | | component.find('select_productCategories').set('v.value', ''); |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Report_Date__c', ''); |
| | | component.set('v.oppdata.Close_Forecasted_Date__c', ''); |
| | | component.set('v.oppdata.Amount__c', ''); |
| | | component.set('v.oppdata.OCMSale_Price__c', ''); |
| | | component.set('v.oppdata.StageName__c', ''); |
| | | component.set('v.Close_Forecasted_Date__c_o', ''); |
| | | component.set('v.Amount__c_o', ''); |
| | | component.set('v.OCMSale_Price__c_o', ''); |
| | | component.set('v.StageName__c_o', ''); |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | this.selectPurposeType(component); |
| | | this.selectProductClassification(component); |
| | | this.selectpurposetype(component); |
| | | }, |
| | | |
| | | report_date_list: function (component, event, helper, count) { |
| | | var ret_obj = []; |
| | | var now = new Date(); |
| | | for (var i = 0; i < count; i++) { |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1 - (i * 7))); |
| | | var end_day = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (7 - now.getDay()) - (i * 7)); |
| | | var start_day_show = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() - (i * 7))); |
| | | var end_day_show = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()) - (i * 7)); |
| | | var date_text = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate() + '~' + end_day.getFullYear() + '/' + (end_day.getMonth() + 1) + '/' + end_day.getDate(); |
| | | if (i == 0) { |
| | | ret_obj.push({ |
| | | selected: true, |
| | | value: start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label: start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | }); |
| | | } else { |
| | | ret_obj.push({ |
| | | selected: false, |
| | | value: start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label: start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | }); |
| | | } |
| | | } |
| | | component.find('select_date').set('v.options', ret_obj); |
| | | component.set('v.report_date_list', ret_obj); |
| | | }, |
| | | create_report_header: function (component, event, helper, name, s_agency, s_date) { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | component.set('v.errorMessage', 'get_date_string failed.'); |
| | | this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var head_key = this.create_header_input_key(s_agency, s_date); |
| | | component.set('v.agency_report_header', head_key); |
| | | if (head_key == false) { |
| | | component.set('v.errorMessage', 'create_header_input_key failed.'); |
| | | this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | var key2 = s_date.replace(/-/g, ''); |
| | | var action = component.get('c.createReportHeader'); |
| | | action.setParams({ |
| | | "name": name, |
| | | "s_date": s_date, |
| | | "s_agency": s_agency, |
| | | "head_key": head_key, |
| | | }); |
| | | component.set('v.login', true); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.set('v.agency_report_header_id', res); |
| | | component.set('v.login', false); |
| | | this.toggle_report(component, event, helper); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'createReportHeader callback failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | create_header_input_key: function (agency_id, s_date) { |
| | | if (typeof (s_date) != 'string') { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | component.set('v.errorMessage', 'get_date_string in create_header_input_key.'); |
| | | this.showErrorToast(component); |
| | | return false; |
| | | } |
| | | } |
| | | if (!agency_id || !s_date) { |
| | | return false; |
| | | } |
| | | s_date = s_date.replace(/-/g, ''); |
| | | var headkey = agency_id + ":" + s_date; |
| | | return headkey; |
| | | }, |
| | | |
| | | /* typeof is not cool |
| | | * @ret : String, Boolean, Date, Error, Array, Function, Null, Undefined, etc |
| | | */ |
| | | object_type: function (obj) { |
| | | var obj_type = Object.prototype.toString.call(obj).slice(8, -1); |
| | | return obj_type; |
| | | }, |
| | | // create yyyy-mm-dd string |
| | | get_date_string: function (val) { |
| | | if (typeof (val) == 'string') { |
| | | if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) { |
| | | val = val.replace(/[\/]/g, '-'); |
| | | var tmp = val.split('-'); |
| | | if (tmp[1].length == 1) { |
| | | tmp[1] = '0' + tmp[1]; |
| | | } |
| | | if (tmp[2].length == 1) { |
| | | tmp[2] = '0' + tmp[2]; |
| | | } |
| | | val = tmp[0] + '-' + tmp[1] + '-' + tmp[2]; |
| | | } else if (val.match(/^\d{4}-\d{1,2}-\d{1,2}$/)) { |
| | | //ok |
| | | } else { |
| | | return false; |
| | | } |
| | | } else if (this.object_type(val) == 'Date') { |
| | | var mm = val.getMonth() + 1; |
| | | if (String(mm).length == 1) { |
| | | mm = '0' + mm; |
| | | } |
| | | var dd = ''; |
| | | if (String(val.getDate()).length == 1) { |
| | | dd = '0' + val.getDate(); |
| | | } else { |
| | | dd = val.getDate(); |
| | | } |
| | | val = val.getFullYear() + '-' + mm + '-' + dd; |
| | | } else { |
| | | return false; |
| | | } |
| | | return val; |
| | | }, |
| | | // Controller 根据页面医院查询符合的医院 |
| | | searchHos: function (component, event, helper) { |
| | | var hospital_name = event.getParam("value"); |
| | | var action = component.get("c.getHospitalList"); |
| | | action.setParams({ |
| | | "hospital_name": hospital_name |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var hospital_list = component.find('hospital_list'); |
| | | var hosList = response.getReturnValue(); |
| | | if (hosList.length > 0) { |
| | | $A.util.addClass(hospital_list, 'slds-is-open'); |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | | component.set("v.hospitalList", response.getReturnValue()); |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | hideSearch: function (component, event, helper) { |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | }, |
| | | hideSearchs: function (component, event, helper) { |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | component.set("v.hospital", ''); |
| | | component.set("v.hospitals", ''); |
| | | component.set('v.hospitalLinkId', ''); |
| | | component.set('v.data.Agency_Hospital__c', ''); |
| | | component.set("v.hospitalId", ''); |
| | | }, |
| | | selectHos: function (component, event, helper) { |
| | | debugger |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | | var accid = event.currentTarget.dataset.accid; |
| | | var hospital_data = component.get('v.hospitalList'); |
| | | var select_purpose_type = component.find('select_purpose_type').get('v.value'); |
| | | for (var i = 0; i < hospital_data.length; i++) { |
| | | if (hospital_data[i].Hospital__c == accid) { |
| | | component.set('v.hospitalLinkId', hospital_data[i].Id); |
| | | component.set('v.data.Agency_Hospital__c', hospital_data[i].Id); |
| | | if(select_purpose_type!='科室会'&&hospital_data[i].Hospital__c){ |
| | | component.find('new_con').set('v.disabled', false); |
| | | }else{ |
| | | component.find('new_con').set('v.disabled', true); |
| | | } |
| | | } |
| | | } |
| | | component.set("v.hospitals", accname); |
| | | component.set("v.hospital", accname); |
| | | component.set("v.hospitalId", accid); |
| | | debugger |
| | | component.set('v.setdoctorlisthos', true); |
| | | this.set_doctor_list(component, event, helper); |
| | | }, |
| | | |
| | | |
| | | //模糊查询使用产品1(产品型号) |
| | | searchUseProduct1: function (component, event, helper) { |
| | | var UseProduct1Name = event.getParam("value"); |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | var action = component.get("c.getUseProduct1"); |
| | | action.setParams({ |
| | | "UseProduct1Name": UseProduct1Name, |
| | | "select_ProductClassification" : select_ProductClassification |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var UseProduct1_List = component.find('UseProduct1_List'); |
| | | var UseProduct1ListValue = response.getReturnValue(); |
| | | if (UseProduct1ListValue.length > 0) { |
| | | $A.util.addClass(UseProduct1_List, 'slds-is-open'); |
| | | } else { |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | } |
| | | component.set("v.UseProduct1List", UseProduct1ListValue); |
| | | } else { |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | hideSearchUseProduct1: function (component, event, helper) { |
| | | var UseProduct1_List = component.find('UseProduct1_List'); |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | }, |
| | | hideSearchUseProduct1s: function (component, event, helper) { |
| | | var UseProduct1_List = component.find('UseProduct1_List'); |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | component.set("v.UseProduct1", ''); |
| | | component.set("v.UseProduct1s", ''); |
| | | component.set('v.UseProduct1Id', ''); |
| | | component.set('v.data.UseProduct1__c', ''); |
| | | }, |
| | | seletUseProduct1Change: function (component, event, helper) { |
| | | debugger |
| | | var UseProduct1_List = component.find('UseProduct1_List'); |
| | | $A.util.removeClass(UseProduct1_List, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | | var accid = event.currentTarget.dataset.accid; |
| | | var UseProduct1ListDate = component.get('v.UseProduct1List'); |
| | | for (var i = 0; i < UseProduct1ListDate.length; i++) { |
| | | if (UseProduct1ListDate[i].Id == accid) { |
| | | component.set('v.UseProduct1Id', UseProduct1ListDate[i].Id); |
| | | component.set('v.data.UseProduct1__c', UseProduct1ListDate[i].Id); |
| | | } |
| | | } |
| | | var UseProduct2_TEXT = component.find('UseProduct2_TEXT').get('v.value'); |
| | | var UseProduct3_TEXT = component.find('UseProduct3_TEXT').get('v.value'); |
| | | if(UseProduct2_TEXT != accname && UseProduct3_TEXT != accname){ |
| | | component.set("v.UseProduct1s", accname); |
| | | component.set("v.UseProduct1", accname); |
| | | }else{ |
| | | component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | } |
| | | }, |
| | | //模糊查询使用产品2 |
| | | searchUseProduct2: function (component, event, helper) { |
| | | var UseProduct2Name = event.getParam("value"); |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | var action = component.get("c.getUseProduct1"); |
| | | action.setParams({ |
| | | "UseProduct1Name": UseProduct2Name, |
| | | "select_ProductClassification" : select_ProductClassification |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var UseProduct2_List = component.find('UseProduct2_List'); |
| | | var UseProduct2List = response.getReturnValue(); |
| | | if (UseProduct2List.length > 0) { |
| | | $A.util.addClass(UseProduct2_List, 'slds-is-open'); |
| | | } else { |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | } |
| | | component.set("v.UseProduct2List", response.getReturnValue()); |
| | | } else { |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | hideSearchUseProduct2: function (component, event, helper) { |
| | | var UseProduct2_List = component.find('UseProduct2_List'); |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | }, |
| | | hideSearchUseProduct2s: function (component, event, helper) { |
| | | var UseProduct2_List = component.find('UseProduct2_List'); |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | component.set("v.UseProduct2", ''); |
| | | component.set("v.UseProduct2s", ''); |
| | | component.set('v.UseProduct2Id', ''); |
| | | component.set('v.data.UseProduct2__c', ''); |
| | | }, |
| | | seletUseProduct2Change: function (component, event, helper) { |
| | | var UseProduct2_List = component.find('UseProduct2_List'); |
| | | $A.util.removeClass(UseProduct2_List, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | | var accid = event.currentTarget.dataset.accid; |
| | | var UseProduct2ListDate = component.get('v.UseProduct2List'); |
| | | for (var i = 0; i < UseProduct2ListDate.length; i++) { |
| | | if (UseProduct2ListDate[i].Id == accid) { |
| | | component.set('v.UseProduct2Id', UseProduct2ListDate[i].Id); |
| | | component.set('v.data.UseProduct2__c', UseProduct2ListDate[i].Id); |
| | | } |
| | | } |
| | | var UseProduct1_TEXT = component.find('UseProduct1_TEXT').get('v.value'); |
| | | var UseProduct3_TEXT = component.find('UseProduct3_TEXT').get('v.value'); |
| | | if(UseProduct1_TEXT != accname && UseProduct3_TEXT != accname){ |
| | | component.set("v.UseProduct2s", accname); |
| | | component.set("v.UseProduct2", accname); |
| | | }else{ |
| | | component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | } |
| | | |
| | | }, |
| | | //模糊查询使用产品3 |
| | | searchUseProduct3: function (component, event, helper) { |
| | | var UseProduct3Name = event.getParam("value"); |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | var action = component.get("c.getUseProduct1"); |
| | | action.setParams({ |
| | | "UseProduct1Name": UseProduct3Name, |
| | | "select_ProductClassification" :select_ProductClassification |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var UseProduct3_List = component.find('UseProduct3_List'); |
| | | var UseProduct3List = response.getReturnValue(); |
| | | if (UseProduct3List.length > 0) { |
| | | $A.util.addClass(UseProduct3_List, 'slds-is-open'); |
| | | } else { |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | } |
| | | component.set("v.UseProduct3List", response.getReturnValue()); |
| | | } else { |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | hideSearchUseProduct3: function (component, event, helper) { |
| | | var UseProduct3_List = component.find('UseProduct3_List'); |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | }, |
| | | hideSearchUseProduct3s: function (component, event, helper) { |
| | | var UseProduct3_List = component.find('UseProduct3_List'); |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | component.set("v.UseProduct3", ''); |
| | | component.set("v.UseProduct3s", ''); |
| | | component.set('v.UseProduct3Id', ''); |
| | | component.set('v.data.UseProduct3__c', ''); |
| | | }, |
| | | seletUseProduct3Change: function (component, event, helper) { |
| | | var UseProduct3_List = component.find('UseProduct3_List'); |
| | | $A.util.removeClass(UseProduct3_List, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | | var accid = event.currentTarget.dataset.accid; |
| | | var UseProduct3ListDate = component.get('v.UseProduct3List'); |
| | | for (var i = 0; i < UseProduct3ListDate.length; i++) { |
| | | if (UseProduct3ListDate[i].Id == accid) { |
| | | component.set('v.UseProduct3Id', UseProduct3ListDate[i].Id); |
| | | component.set('v.data.UseProduct3__c', UseProduct3ListDate[i].Id); |
| | | } |
| | | } |
| | | var UseProduct1_TEXT = component.find('UseProduct1_TEXT').get('v.value'); |
| | | var UseProduct2_TEXT = component.find('UseProduct2_TEXT').get('v.value'); |
| | | if(UseProduct1_TEXT != accname && UseProduct2_TEXT != accname ){ |
| | | component.set("v.UseProduct3s", accname); |
| | | component.set("v.UseProduct3", accname); |
| | | }else{ |
| | | component.set('v.errorMessage', '不能选择同样的产品'); |
| | | this.showErrorToast(component); |
| | | } |
| | | |
| | | }, |
| | | //hospitalLinkId 经销商医院的ID 拜访人复制的地方 |
| | | doctor_change: function (component, event, helper) { |
| | | debugger |
| | | var doctorurpose = component.find('select_purpose_type').get('v.value'); |
| | | var doctor_value = component.find('select_doctor').get('v.value'); |
| | | var doctor_list = component.get('v.doctor_list'); |
| | | var flg = false; |
| | | if(doctor_list){ |
| | | for (var i = 0; i < doctor_list.length; i++) { |
| | | if (doctor_list[i].value == doctor_value) { |
| | | if(doctorurpose == '科室会'){ |
| | | // component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c); |
| | | }else{ |
| | | component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c); |
| | | } |
| | | flg = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (flg == false) { |
| | | component.set('v.doctor_title', ''); |
| | | } |
| | | }, |
| | | //SWAG-CF58C3 fy start 调用pi |
| | | set_aws_url : function(component,sobject) { |
| | | var action = component.get('c.getAwsurl'); |
| | | action.setParams({ |
| | | "sobj" : sobject, |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var awsmap = this.conv_selected(response.getReturnValue()); |
| | | component.set('v.AWStoken',awsmap.token); |
| | | component.set('v.AWSinsert',awsmap.newUrl); |
| | | component.set('v.AWSsearch',awsmap.searchUrl); |
| | | component.set('v.AWStransactionURL',awsmap.transactionURL); |
| | | } |
| | | else{ |
| | | component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper,hospitalName) { |
| | | fetch(newUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | if(result.status == '0'){ |
| | | $A.getCallback(function(){ |
| | | helper.to_agencycontact(component,result,agencyHospitalid); |
| | | })(); |
| | | }else{ |
| | | console.log('AWS status error:' + result) |
| | | component.set('v.login',false); |
| | | if(result.status == '129'){ |
| | | component.find('OppMessage').setError('该客户人员名字已存在,在'+hospitalName+'医院,请修改'); |
| | | }else{ |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.log('AWS insert error:' + error) |
| | | component.set('v.login',false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | }); |
| | | |
| | | }, |
| | | |
| | | to_agencycontact : function(component,result,agencyHospitalid) { |
| | | var action = component.get('c.saveAgencyContact'); |
| | | action.setParams({ |
| | | "name" : result.object[0].name, |
| | | //"nameEncrypt" : result.object[0].nameEncrypt, //zhj 新方案改造 2023-12-21 |
| | | "type" : result.object[0].type, |
| | | //"typeEncrypt" : result.object[0].typeEncrypt, //zhj 新方案改造 2023-12-21 |
| | | "doctorDivision1" : result.object[0].doctorDivision1, |
| | | //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, //zhj 新方案改造 2023-12-21 |
| | | "agencyHospitalid" : agencyHospitalid, |
| | | "awsid" : result.object[0].dataId, |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var acMap = this.conv_selected(response.getReturnValue()); |
| | | console.log(acMap); |
| | | if(acMap.AgencyContactId != ''){ |
| | | //确认事务 |
| | | var token = component.get('v.AWStoken'); |
| | | var confirmUrl = component.get('v.AWStransactionURL'); |
| | | |
| | | let data = Object.create(null); |
| | | data['isSuccess'] = 1; |
| | | data['sfRecordId'] = ''; |
| | | data['txId'] = result.txId; |
| | | |
| | | this.to_confirm(component,token,confirmUrl,JSON.stringify(data)); |
| | | }else if(acMap.errormsg != ''){ |
| | | component.set('v.errorMessage', acMap.errormsg); |
| | | this.showErrorToast(component); |
| | | component.set('v.login',false); |
| | | }else { |
| | | component.set('v.errorMessage', 'agency contact insert id error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login',false); |
| | | } |
| | | } |
| | | else{ |
| | | component.set('v.errorMessage', 'agency contact insert error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | to_confirm : function(component,token,confirmUrl,payload,event) { |
| | | fetch(confirmUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | if(result.status == '0' && result.hasOwnProperty('success') && result.success){ |
| | | // component.set('v.truthy', false); |
| | | // var modal_newAC = component.find('modal_newAC') |
| | | // $A.util.addClass(modal_newAC, 'disp_none'); |
| | | // this.success('.客户人员已创建。'); |
| | | // this.set_doctor_list(component); |
| | | |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.set('v.successMessage', '.拜访人已创建。'); |
| | | this.showSuccessToast(component); |
| | | this.set_doctor_list(component); |
| | | }else { |
| | | component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login',false); |
| | | } |
| | | }).catch(error => { |
| | | component.set('v.errorMessage', 'AWS confirm error.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login',false); |
| | | }); |
| | | }, |
| | | //SWAG-CF58C3 fy end 调用pi |
| | | |
| | | set_doctor_list: function (component) { |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | if (hospital_id) { |
| | | if(doctor_value == '科室会'){ |
| | | component.set('v.login', true); |
| | | this.set_doctor_list2(component); |
| | | }else{ |
| | | component.set('v.login', true); |
| | | var action = component.get('c.getDoctorList'); |
| | | action.setParams({ |
| | | "hospital_id": hospital_id, |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | debugger; |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | //fy |
| | | var setdoctorlisthos = component.get('v.setdoctorlisthos'); |
| | | if(setdoctorlisthos){ |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.setdoctorlisthos', false); |
| | | } |
| | | //fy |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].value == default_doctor) { |
| | | res[i].selected = true; |
| | | doctor_title = res[i].Doctor_Division1__c; |
| | | } else { |
| | | res[i].selected = false; |
| | | } |
| | | if(res[i].AWS_Data_Id__c){ |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | component.set('v.doctor_title', doctor_title); |
| | | |
| | | if(awsids.length > 0){ |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | AWSService.search(staticResourceAgencyContact.searchUrl,{ |
| | | dataIds:awsids |
| | | }, function(data){ |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for(let ri in res){ |
| | | if(res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)){ |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | } |
| | | |
| | | component.set('v.login', false); |
| | | }, staticResourceAgencyContact.token); |
| | | } |
| | | } else { |
| | | let awsids = []; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if(res[i].AWS_Data_Id__c){ |
| | | awsids.push(res[i].AWS_Data_Id__c); |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | if(awsids.length > 0){ |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | AWSService.search(staticResourceAgencyContact.searchUrl,{ |
| | | dataIds:awsids |
| | | }, function(data){ |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for(let ri in res){ |
| | | if(res[ri] && res[ri].AWS_Data_Id__c && m.hasOwnProperty(res[ri].AWS_Data_Id__c)){ |
| | | res[ri].label = m[res[ri].AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | } |
| | | |
| | | component.set('v.login', false); |
| | | }, staticResourceAgencyContact.token); |
| | | } |
| | | // component.find('select_doctor').set('v.options', res); |
| | | if (res.length > 0) { |
| | | component.set('v.doctor_title', res[0].Doctor_Division1__c); |
| | | } |
| | | } |
| | | // component.set('v.default_select_doctor_id', ''); |
| | | debugger |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'set_doctor_list failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | |
| | | }else{ |
| | | if(doctor_value == '科室会'){ |
| | | this.set_doctor_list2(component); |
| | | }else{ |
| | | component.find('select_doctor').set('v.options', ''); |
| | | } |
| | | } |
| | | },//fy 20220414 |
| | | set_doctor_list2:function (component) { |
| | | var action1 = component.get('c.selectdoctor3c'); |
| | | action1.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | debugger |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].selected == 'true') { |
| | | res[i].selected = true; |
| | | } else { |
| | | res[i].selected = false; |
| | | } |
| | | } |
| | | debugger |
| | | component.find('select_doctor').set('v.options', res); |
| | | var doctor3value = component.get('v.default_select_doctor_id2'); |
| | | this.set_selected(component, 'select_doctor', doctor3value); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action1); |
| | | }, |
| | | productcategoryChange1: function (component, event, helper) { |
| | | var product_category_id = component.find('select_Product1').get('v.value'); |
| | | var pcId1 = component.find('select_Product2').get('v.value'); |
| | | var pcId2 = component.find('select_Product3').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | component.find('select_Product1').set('v.value', ''); |
| | | } |
| | | }, |
| | | productcategoryChange2: function (component, event, helper) { |
| | | var product_category_id = component.find('UseProduct2_TEXT').get('v.value'); |
| | | var pcId1 = component.find('UseProduct1_TEXT').get('v.value'); |
| | | var pcId2 = component.find('UseProduct3_TEXT').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null ; |
| | | var p2bool = pcId2 != '' && pcId2 != null ; |
| | | var p0bool = product_category_id != '' && product_category_id != null; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | component.set('v.UseProduct2_TEXT',''); |
| | | } |
| | | }, |
| | | productcategoryChange3: function (component, event, helper) { |
| | | var product_category_id = component.find('select_Product3').get('v.value'); |
| | | var pcId1 = component.find('select_Product1').get('v.value'); |
| | | var pcId2 = component.find('select_Product2').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | component.set('v.errorMessage', '不能选择同样的产品区分'); |
| | | this.showErrorToast(component); |
| | | component.find('select_Product3').set('v.value', ''); |
| | | } |
| | | }, |
| | | conv_selected: function (obj) { |
| | | for (var i = 0; i < obj.length; i++) { |
| | | if (obj[i].selected) { |
| | | if (obj[i].selected == 'true') { |
| | | obj[i].selected = true; |
| | | } else { |
| | | obj[i].selected = false; |
| | | } |
| | | } |
| | | } |
| | | return obj; |
| | | }, |
| | | set_selected: function (component, aura_id_name, value) { |
| | | debugger; |
| | | var select_tmp = component.find(aura_id_name).get('v.options'); |
| | | if (select_tmp) { |
| | | for (var i = 0; i < select_tmp.length; i++) { |
| | | if (select_tmp[i].value == value) { |
| | | select_tmp[i].selected = true; |
| | | } else { |
| | | select_tmp[i].selected = false; |
| | | } |
| | | } |
| | | component.find(aura_id_name).set('v.options', select_tmp); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast: function (component) { |
| | | debugger |
| | | $A.util.removeClass(component.find('successDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv'), 'slds-hide'); |
| | | }), |
| | | 3000 |
| | | ); |
| | | }, |
| | | //弹出 成功提示 |
| | | showSuccessToast01: function (component) { |
| | | debugger |
| | | $A.util.removeClass(component.find('successDiv01'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('successDiv01'), 'slds-hide'); |
| | | }), |
| | | 3000 |
| | | ); |
| | | }, |
| | | //弹出 错误提示 |
| | | showErrorToast: function (component) { |
| | | debugger |
| | | $A.util.removeClass(component.find('errorDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | 3000 |
| | | ); |
| | | }, |
| | | //弹出 错误提示 |
| | | showErrorToast01: function (component) { |
| | | debugger |
| | | $A.util.removeClass(component.find('errorDiv01'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv01'), 'slds-hide'); |
| | | }), |
| | | 6000 |
| | | ); |
| | | }, |
| | | error: function (message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type": "error", |
| | | "duration": "sticky" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | createCon: function (component, event, helper) { |
| | | var modal_newAC = component.find('modal_newAC'); |
| | | $A.util.removeClass(modal_newAC, 'disp_none'); |
| | | component.set('v.truthy', true); |
| | | }, |
| | | hideCmp: function (component, event, helper) { |
| | | var div1 = component.find('report') |
| | | var div2 = component.find('report_list') |
| | | $A.util.addClass(div1, 'disp_none'); |
| | | $A.util.addClass(div2, 'disp_none'); |
| | | }, |
| | | handleSuccess: function (component, event, helper) { |
| | | var insertId = event.getParams().response.Id; |
| | | var displayValue = event.getParams().response.fields.Name.value; |
| | | event.setParams({}); |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.set('v.successMessage', '.拜访人已创建。'); |
| | | this.showSuccessToast(component); |
| | | this.set_doctor_list(component, event, helper); |
| | | }, |
| | | createCancel: function (component, event, helper) { |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | component.find('OppMessage').setError(''); |
| | | }, |
| | | //科室赋值 |
| | | setOpportunity_cfilter: function (component) { |
| | | var hosId = component.get('v.hospitalId'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var opportunity_cfilter = ''; |
| | | if (hosId != '' && hosId != null) { |
| | | opportunity_cfilter = ' Agency_Hospital__r.Hospital__c=' + '\'' + hosId + '\''; |
| | | } |
| | | if (Department_Cateogy__c != '' && Department_Cateogy__c != null) { |
| | | if (opportunity_cfilter != '' && opportunity_cfilter != null) { |
| | | opportunity_cfilter += ' AND '; |
| | | } |
| | | // fy Department_Cateogy_text__c |
| | | opportunity_cfilter += 'Department_Cateogy__c=' + '\'' + Department_Cateogy__c + '\''; |
| | | // opportunity_cfilter += 'Department_Cateogy_text__c=' + '\'' + Department_Cateogy__c + '\''; |
| | | } |
| | | component.set('v.opportunity_cfilter', opportunity_cfilter); |
| | | }, |
| | | readFile: function (component, helper, file) { |
| | | if (!file) return; |
| | | if (!file.name.match(/\.(csv||CSV)$/)) { |
| | | return alert('only support csv files'); |
| | | } else { |
| | | reader = new FileReader(); |
| | | reader.onerror = function errorHandler(evt) { |
| | | switch (evt.target.error.code) { |
| | | case evt.target.error.NOT_FOUND_ERR: |
| | | alert('File Not Found!'); |
| | | break; |
| | | case evt.target.error.NOT_READABLE_ERR: |
| | | alert('File is not readable'); |
| | | break; |
| | | case evt.target.error.ABORT_ERR: |
| | | break; // noop |
| | | default: |
| | | alert('An error occurred reading this file.'); |
| | | }; |
| | | } |
| | | reader.onabort = function (e) { |
| | | alert('File read cancelled'); |
| | | }; |
| | | reader.onloadstart = function (e) { |
| | | var output = '<ui type=\"disc\"><li><strong>' + file.name + '</strong> (' + file.type + ')- ' + file.size + 'bytes, last modified: ' + file.lastModifiedDate.toLocaleDateString() + '</li></ui>'; |
| | | component.set("v.filename", file.name); |
| | | component.set("v.TargetFileName", output); |
| | | }; |
| | | reader.onload = function (e) { |
| | | debugger; |
| | | var data = e.target.result; |
| | | |
| | | component.set("v.fileContentData", data); |
| | | console.log("file data" + JSON.stringify(data)); |
| | | var allTextLines = data.split(/\r\n|\n/); |
| | | console.log("qqqqqqqqqqqqqqqqqqq" + allTextLines); |
| | | var dataRows = allTextLines.length - 1; |
| | | var headers = allTextLines[0].split(','); |
| | | var numOfRows = component.get("v.NumOfRecords"); |
| | | if (dataRows > numOfRows + 1 || dataRows == 1 || dataRows == 0) { |
| | | alert("File Rows between 1 to " + numOfRows + " ."); |
| | | component.set("v.showMain", true); |
| | | } |
| | | else { |
| | | var lines = []; |
| | | var filecontentdata; |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | content += '<th scope=\"col"\>' + '行号' + '</th>'; |
| | | for (i = 0; i < headers.length; i++) { |
| | | content += '<th scope=\"col"\>' + headers[i] + '</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | for (var i = 1; i < allTextLines.length; i++) { |
| | | filecontentdata = allTextLines[i].split(','); |
| | | if (filecontentdata[0] != '') { |
| | | content += "<tr>"; |
| | | content += "<td>" + i + "</td>"; |
| | | for (var j = 0; j < filecontentdata.length; j++) { |
| | | content += '<td>' + filecontentdata[j] + '</td>'; |
| | | } |
| | | content += "</tr>"; |
| | | } |
| | | } |
| | | content += "</table>"; |
| | | console.log(content); |
| | | component.set("v.TableContent", content); |
| | | component.set("v.showMain", false); |
| | | } |
| | | } |
| | | reader.readAsText(file, 'gb2312'); |
| | | |
| | | } |
| | | var reader = new FileReader(); |
| | | reader.onloadend = function () { |
| | | }; |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | // fy 调用pi改造的 获取url 和 token的方法 |
| | | search_contact_url : function(component, sobject, callback) { |
| | | var action = component.get("c.getAwsurl"); |
| | | action.setParams({ |
| | | sobj : sobject |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var result = response.getReturnValue(); |
| | | if(callback)callback(result); |
| | | } |
| | | else{ |
| | | component.set('v.errorMessage', 'AWS url/token error.'); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | // fy 调用pi改造的 获取.客户人员的方法 |
| | | search_core: function (token, searchUrl, payload, callback, component) { |
| | | console.log('searchUrl = ' + searchUrl); |
| | | fetch(searchUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | component.set('v.login',false); |
| | | if(callback)callback(result); |
| | | }).catch(error => { |
| | | console.log('AWS search error = ' + JSON.stringify(error)); |
| | | component.set('v.errorMessage', 'AWS search error.'); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login',false); |
| | | }); |
| | | }, |
| | | saveRecords: function (component, event, helper) { |
| | | component.set('v.login', true); |
| | | //fy 导入 202200506 start |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | action1.setParams({ |
| | | fileData : component.get("v.fileContentData"), |
| | | }); |
| | | action1.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | debugger |
| | | var ress = response.getReturnValue(); |
| | | if(ress){ |
| | | var valur =ress.split('error1'); |
| | | if(valur.length<=1){ |
| | | var res = JSON.parse(response.getReturnValue()); |
| | | debugger |
| | | var dataArr = new Array(); |
| | | var dataMap = new Map(); |
| | | res.forEach(item => { |
| | | if(item.AWS_Data_Id__c){ |
| | | dataArr.push(item.AWS_Data_Id__c); |
| | | //dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c); //zhj 新方案改造 2022-12-21 |
| | | dataMap.set(item.AWS_Data_Id__c,item.AWS_Data_Id__c); |
| | | } |
| | | }); |
| | | debugger |
| | | let obj= Object.create(null); |
| | | obj['dataIds'] = dataArr; |
| | | var payload = JSON.stringify(obj); |
| | | this.search_contact_url(component, 'Agency_Contact__c', (result)=>{ |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | if(result.status == '0'){ |
| | | if(result.object != null&&result.object.length != 0){ |
| | | component.set('v.login',true); |
| | | this.saveRecordsEditFile(component,dataMap,result.object,helper); |
| | | }else{ |
| | | component.set('v.errorMessage', 'AWS search status '); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login',false); |
| | | } |
| | | }else{ |
| | | component.set('v.errorMessage', 'AWS search status : ' + result.status); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | | }); |
| | | }else{ |
| | | component.set('v.errorMessage', valur[1]+'\n'+"请修改后重新上传"); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login',false); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(action1); |
| | | // var action = component.get("c.processData"); |
| | | // var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic fields |
| | | // var filedata =component.get("v.fileContentData"); |
| | | // action.setParams({ |
| | | // fileData: filedata, |
| | | // sobjectName: 'Account', //Any object |
| | | // fields: fieldsList |
| | | // }); |
| | | // action.setCallback(this, function (response) { |
| | | // var state = response.getState(); |
| | | // if (state === "SUCCESS") { |
| | | // var res = response.getReturnValue(); |
| | | // var res1 = ''; |
| | | // if (res != 'success') { |
| | | // var ress = res.split('='); |
| | | // console.log(ress); |
| | | // for (var i = 0; i < ress.length; i++) { |
| | | // res1 += ress[i].substr(7) + '\n'; |
| | | // } |
| | | // console.log("==" + res1); |
| | | // component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | // this.showErrorToast01(component); |
| | | // component.set('v.login', false); |
| | | // } else { |
| | | // component.set('v.successMessage', '导入成功'); |
| | | // this.showSuccessToast01(component); |
| | | // component.set("v.showMain", true); |
| | | // component.set('v.login', false); |
| | | // this.doinit(component, event, helper); |
| | | // } |
| | | // } |
| | | // else if (state === "INCOMPLETE") { |
| | | // component.set('v.login', false); |
| | | // } |
| | | // else if (state === "ERROR") { |
| | | // var errors = response.getError(); |
| | | // if (errors) { |
| | | // if (errors[0] && errors[0].message) { |
| | | // console.log("Error message: " + |
| | | // errors[0].message); |
| | | // component.set('v.login', false); |
| | | // } |
| | | // } else { |
| | | // console.log("Unknown error"); |
| | | // component.set('v.login', false); |
| | | // } |
| | | // } |
| | | // }); |
| | | // $A.enqueueAction(action); |
| | | |
| | | }, |
| | | saveRecordsEditFile : function(component,dataMap,searchData,helper){ |
| | | var searchDataMap = new Map(); |
| | | for (var i = 0; i < searchData.length; i++) { |
| | | var sd = searchData[i]; |
| | | searchDataMap.set(sd.name.replace(' ',''),sd.dataId); |
| | | } |
| | | console.log('searchDataMap='+searchDataMap); |
| | | var error = ''; |
| | | var fileData = component.get("v.fileContentData"); |
| | | fileData=this.ToCDB(fileData);//全角转半角 |
| | | var files = fileData.split('\n'); |
| | | |
| | | var fileStr = files[0]; |
| | | fileStr += '\n'; |
| | | |
| | | for (var i = 1; i < files.length-1; i++) { |
| | | if(files[i]){ |
| | | var filelist = files[i].split(','); |
| | | var fileName = filelist[5]; |
| | | var WorkRecord = filelist[4]; |
| | | if(WorkRecord == 'SIS'||WorkRecord == '院内入院申请'||WorkRecord == '收费项目申请'||WorkRecord == '科室会'){ |
| | | if(fileName){ |
| | | if(WorkRecord != '科室会'){ |
| | | if (searchDataMap.get(fileName.replace(' ',''))) { |
| | | var nameDataId = searchDataMap.get(fileName.replace(' ','')); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[5] = dataMap.get(nameDataId); //zhj 新方案改造 filelist[5]不再存的nameEncrpt 2022-12-21 |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人SF不存在'; |
| | | } |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人AWS不存在'; |
| | | } |
| | | }else{ |
| | | if(filelist[5]!='医生'&&filelist[5]!='医生+护士'){//&&filelist[5]!='医生+护士' |
| | | error += 'error1 第'+i+'行数据拜访人不存在'; |
| | | } |
| | | } |
| | | }else{ |
| | | error += 'error1 第'+i+'行数据拜访人不能为空'; |
| | | } |
| | | }else{ |
| | | if(fileName){ |
| | | if(WorkRecord != '科室会'){ |
| | | if (searchDataMap.get(fileName.replace(' ',''))) { |
| | | var nameDataId = searchDataMap.get(fileName.replace(' ','')); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[5] = dataMap.get(nameDataId); |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人SF不存在'; |
| | | } |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人AWS不存在'; |
| | | } |
| | | }else{ |
| | | if(filelist[5]!='医生'&&filelist[5]!='医生+护士'){//&&filelist[5]!='医生+护士' |
| | | error += 'error1 第'+i+'行数据拜访人不存在'; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | fileStr += filelist.toString(); |
| | | fileStr += '\n'; |
| | | } |
| | | } |
| | | |
| | | if (error != '') { |
| | | component.set('v.errorMessage', error); |
| | | this.showErrorToast01(component); |
| | | console.log('error='+error); |
| | | component.set('v.login',false); |
| | | return; |
| | | } |
| | | |
| | | console.log('fileStr='+fileStr); |
| | | $A.getCallback(function(){ |
| | | debugger |
| | | helper.ImportMethod(component,fileStr,helper); |
| | | })(); |
| | | |
| | | },ImportMethod : function(component,fileStr,helper){ |
| | | var action = component.get("c.processData"); |
| | | var fieldsList = ['Name', 'Phone', 'AccountNumber']; //Please write your code dynamic fields |
| | | // var filedata =component.get("v.fileContentData"); |
| | | action.setParams({ |
| | | fileData: fileStr, |
| | | sobjectName: 'Account', //Any object |
| | | fields: fieldsList |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | if (res != 'success') { |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | for (var i = 0; i < ress.length; i++) { |
| | | res1 += ress[i].substr(7) + '\n'; |
| | | } |
| | | console.log("==" + res1); |
| | | component.set('v.errorMessage', res1 + "请修改后重新上传"); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login', false); |
| | | } else { |
| | | component.set('v.successMessage', '导入成功'); |
| | | this.showSuccessToast01(component); |
| | | component.set("v.showMain", true); |
| | | component.set('v.login', false); |
| | | this.doinit(component, event, helper); |
| | | } |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | component.set('v.login', false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | component.set('v.login', false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set('v.login', false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | },//全角转半角 |
| | | ToCDB: function (str) { |
| | | var tmp = ""; |
| | | for (var i = 0; i < str.length; i++) { |
| | | if (str.charCodeAt(i) > 65248 && str.charCodeAt(i) < 65375) { |
| | | tmp += String.fromCharCode(str.charCodeAt(i) - 65248); |
| | | } |
| | | else { |
| | | tmp += String.fromCharCode(str.charCodeAt(i)); |
| | | } |
| | | } |
| | | return tmp |
| | | }, |
| | | //导出的CSV文件 |
| | | convertArrayOfObjectsToCSV: function (component, objectRecords) { |
| | | var csvStringResult, counter, keys, columnDivider, lineDivider, thkeys; |
| | | if (objectRecords == null || !objectRecords.length) { |
| | | return null; |
| | | } |
| | | columnDivider = ','; |
| | | lineDivider = '\n'; |
| | | keys = [ 'Report_Date__c', 'Agency_Hospital__c','Department_Cateogy_text__c','DealerPersonnel__c','WorkRecord__c','doctor2__c','ProductClassification__c','UseProduct1__c', 'UseProduct2__c','UseProduct3__c', 'EffectProgress__c','ConsumptionOfConsumables__c', 'WarlockClassification__c', 'ProductCcategory__c', 'productCategories__c','warlocksNumber__c','WorkMark__c']; |
| | | thkeys = ['活动日', '医院', '科室', '经销商人员', '活动区分', '拜访人','产品分类(第三分类)', '使用产品1(产品型号)', '使用产品2','使用产品3','效果/进度','产品1同类耗材科室月使用量','产品1对应术式分类','已采用其他品牌','其他品牌产品类别','产品用量','支援需求'] |
| | | csvStringResult = ''; |
| | | csvStringResult += thkeys.join(columnDivider); |
| | | csvStringResult += lineDivider; |
| | | console.log("进入导出helper"); |
| | | for (var i = 0; i < objectRecords.length; i++) { |
| | | counter = 0; |
| | | for (var sTempkey in keys) { |
| | | var skey = keys[sTempkey]; |
| | | if (counter > 0) { |
| | | csvStringResult += columnDivider; |
| | | } |
| | | if (typeof objectRecords[i][skey] === "undefined") { |
| | | csvStringResult += '' + '' + ''; |
| | | continue; |
| | | } |
| | | if (skey == 'Person_In_Charge2__c') { |
| | | csvStringResult += objectRecords[i].Person_In_Charge2__r.Name; |
| | | } else if (skey == 'Agency_Hospital__c') { |
| | | csvStringResult += objectRecords[i].Agency_Hospital__r.Name; |
| | | } else if (skey == 'DealerPersonnel__c') { |
| | | csvStringResult += objectRecords[i].DealerPersonnel__r.Name; |
| | | } else if (skey == 'doctor2__c') { |
| | | csvStringResult += objectRecords[i].doctor2__r.Name; |
| | | } else if (skey == 'UseProduct1__c') { |
| | | csvStringResult += objectRecords[i].UseProduct1__r.Asset_Model_No__c; |
| | | } else if (skey == 'UseProduct2__c') { |
| | | csvStringResult += objectRecords[i].UseProduct2__r.Asset_Model_No__c; |
| | | } else if (skey == 'UseProduct3__c') { |
| | | csvStringResult += objectRecords[i].UseProduct3__r.Asset_Model_No__c; |
| | | }else{ |
| | | csvStringResult += objectRecords[i][skey] ; |
| | | } |
| | | counter++; |
| | | } |
| | | console.log("导出循环结束"); |
| | | csvStringResult += lineDivider; |
| | | } |
| | | return csvStringResult; |
| | | }, |
| | | // 导出页面显示的模板 |
| | | showExportDate: function (component, objectRecords) { |
| | | console.log('进入showexceportdate' + objectRecords); |
| | | var keys = ['Report_Date__c', 'Agency_Hospital__c','Department_Cateogy_text__c','DealerPersonnel__c','WorkRecord__c','doctor2__c','ProductClassification__c','UseProduct1__c', 'UseProduct2__c','UseProduct3__c', 'EffectProgress__c','ConsumptionOfConsumables__c', 'WarlockClassification__c', 'ProductCcategory__c','productCategories__c', 'warlocksNumber__c','WorkMark__c']; |
| | | var headers = ['活动日', '医院', '科室', '经销商人员', '活动区分', '拜访人','产品分类(第三分类)', '使用产品1(产品型号)', '使用产品2','使用产品3','效果/进度','产品1同类耗材科室月使用量','产品1对应术式分类','已采用其他品牌','其他品牌产品类别','产品用量','支援需求'] |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | for (i = 0; i < headers.length; i++) { |
| | | content += '<th scope=\"col"\>' + headers[i] + '</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | for (var i = 0; i < objectRecords.length; i++) { |
| | | console.log('for' + content); |
| | | content += '<tr>'; |
| | | for (var sTempkey in keys) { |
| | | console.log('for1' + sTempkey); |
| | | var skey = keys[sTempkey]; |
| | | if (typeof objectRecords[i][skey] === "undefined") { |
| | | content += '<td>' + '' + '</td>'; |
| | | continue; |
| | | } |
| | | console.log('for2' + objectRecords[i].Person_In_Charge2__r.Name); |
| | | if (skey == 'Person_In_Charge2__c') { |
| | | content += '<td>' + objectRecords[i].Person_In_Charge2__r.Name + '</td>'; |
| | | } else if (skey == 'Agency_Hospital__c') { |
| | | content += '<td>' + objectRecords[i].Agency_Hospital__r.Name + '</td>'; |
| | | } else if (skey == 'DealerPersonnel__c') { |
| | | content += '<td>' + objectRecords[i].DealerPersonnel__r.Name + '</td>'; |
| | | } else if (skey == 'doctor2__c') { |
| | | content += '<td>' + objectRecords[i].doctor2__r.Name + '</td>'; |
| | | } else if (skey == 'UseProduct1__c') { |
| | | content += '<td>' + objectRecords[i].UseProduct1__r.Asset_Model_No__c + '</td>'; |
| | | } else if (skey == 'UseProduct2__c') { |
| | | content += '<td>' + objectRecords[i].UseProduct2__r.Asset_Model_No__c + '</td>'; |
| | | } else if (skey == 'UseProduct3__c') { |
| | | content += '<td>' + objectRecords[i].UseProduct3__r.Asset_Model_No__c + '</td>'; |
| | | }else{ |
| | | content += '<td>' + objectRecords[i][skey] + '</td>'; |
| | | } |
| | | } |
| | | content += '</tr>' |
| | | } |
| | | content += '</table>'; |
| | | console.log("helper循环结束" + content); |
| | | component.set("v.TableContent2", content); |
| | | component.set("v.showMain", false); |
| | | }, |
| | | |
| | | select_repores_date: function (component, event, helper) { |
| | | component.set('v.login', true); |
| | | var reportsdate1 = component.find('input-report-date1').get('v.value'); |
| | | var reportsdate2 = component.find('input-report-date2').get('v.value'); |
| | | console.log('输入的开始日期' + reportsdate1 + '输入的结束日期' + reportsdate2); |
| | | var action = component.get("c.getReportsByDate"); |
| | | console.log('输入的开始日期1'); |
| | | action.setParams({ |
| | | date1: reportsdate1, |
| | | date2: reportsdate2 |
| | | }); |
| | | console.log('输入的开始日期2'); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | console.log('输入的开始日期3' + res); |
| | | component.set('v.login', false); |
| | | |
| | | // PI 改造 By Bright 20220328 |
| | | if(true){ |
| | | let awsids = []; |
| | | for (let ri in res) { |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c){ |
| | | awsids.push(res[ri].doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | if(awsids.length > 0){ |
| | | let PIConfig = component.get('v.PIConfig'); |
| | | let staticResourceAgencyContact = JSON.parse(PIConfig.staticResourceAgencyContact); |
| | | AWSService.search(staticResourceAgencyContact.searchUrl,{ |
| | | dataIds:awsids |
| | | }, function(data){ |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for(let ri in res){ |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)){ |
| | | res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name; |
| | | } |
| | | } |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set('v.login', false); |
| | | }, staticResourceAgencyContact.token); |
| | | }else{ |
| | | helper.showExportDate(component, res); |
| | | } |
| | | } |
| | | |
| | | |
| | | component.set('v.reports_date', res); |
| | | } else { |
| | | alert('导出失败,请检查活动日'); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | }, |
| | | |
| | | showImport: function (component) { |
| | | var modalimport = component.find('modal_import'); |
| | | var modalimportbg = component.find('modal_importbg'); |
| | | $A.util.removeClass(modalimport, 'disp_none'); |
| | | $A.util.removeClass(modalimportbg, 'disp_none'); |
| | | }, |
| | | |
| | | showExport: function (component) { |
| | | var modalimport = component.find('modal_export'); |
| | | var modalimportbg = component.find('modal_exportbg'); |
| | | $A.util.removeClass(modalimport, 'disp_none'); |
| | | $A.util.removeClass(modalimportbg, 'disp_none'); |
| | | }, |
| | | |
| | | close_import: function (component) { |
| | | var modalimport = component.find('modal_import'); |
| | | var modalimportbg = component.find('modal_importbg'); |
| | | $A.util.addClass(modalimport, 'disp_none'); |
| | | $A.util.addClass(modalimportbg, 'disp_none'); |
| | | }, |
| | | |
| | | close_export: function (component) { |
| | | var modalimport = component.find('modal_export'); |
| | | var modalimportbg = component.find('modal_exportbg'); |
| | | $A.util.addClass(modalimport, 'disp_none'); |
| | | $A.util.addClass(modalimportbg, 'disp_none'); |
| | | }, |
| | | //页面中的新建职位按钮 |
| | | newlyBuild: function (component, event, helper) { |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | event.preventDefault(); // stop form submission |
| | | var fields = component.find("newOpportunityField"); |
| | | var nameer = ''; |
| | | var type = ''; |
| | | var doctorDivision1 = ''; |
| | | fields.forEach(function (field) { |
| | | if (field.get("v.fieldName") === 'Name') { |
| | | nameer = field.get("v.value"); |
| | | } |
| | | if (field.get("v.fieldName") === 'Type__c') { |
| | | type = field.get("v.value"); |
| | | } |
| | | if (field.get("v.fieldName") === 'Doctor_Division1__c') { |
| | | doctorDivision1 = field.get("v.value"); |
| | | } |
| | | }); |
| | | if (hospital_id) { |
| | | component.set('v.login', true); |
| | | var action = component.get('c.newlyBuild'); |
| | | action.setParams({ |
| | | "hospital_id": hospital_id, |
| | | "nameer": nameer, |
| | | "type": type, |
| | | "doctorDivision1": doctorDivision1, |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = this.conv_selected(response.getReturnValue()); |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].value == default_doctor) { |
| | | res[i].selected = true; |
| | | doctor_title = res[i].Doctor_Division1__c; |
| | | } else { |
| | | res[i].selected = false; |
| | | } |
| | | } |
| | | component.find('select_doctor').set('v.options', res); |
| | | component.set('v.doctor_title', doctor_title); |
| | | } else { |
| | | component.find('select_doctor').set('v.options', res); |
| | | if (res.length > 0) { |
| | | component.set('v.doctor_title', res[0].Doctor_Division1__c); |
| | | } |
| | | } |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.login', false); |
| | | } |
| | | else { |
| | | component.set('v.errorMessage', 'newlyBuild failed.'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | }, |
| | | //科室同类耗材验证必须输入数字 |
| | | select_ConsumptionOfConsumables : function(component, event, helper) { |
| | | var sc = event.getSource().get('v.value'); |
| | | if(sc != null){ |
| | | if(sc.length <= 14){ |
| | | if(sc.replace(/\D/gi,"")){ |
| | | component.set("v.select_ConsumptionOfConsumables",sc); |
| | | }else{ |
| | | component.set('v.errorMessage', '产品1同类耗材科室月使用量必须输入数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | }else{ |
| | | component.set('v.errorMessage', '产品1同类耗材科室月使用量最多输入14位数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | } |
| | | }, |
| | | //产品用量验证必须输入数字 |
| | | select_warlocksNumber : function(component, event, helper) { |
| | | var sc = event.getSource().get('v.value'); |
| | | if(sc != null){ |
| | | if(sc.length <= 14){ |
| | | if(sc.replace(/\D/gi,"")){ |
| | | component.set("v.select_warlocksNumber",sc); |
| | | }else{ |
| | | component.set('v.errorMessage', '产品用量必须输入数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | }else{ |
| | | component.set('v.errorMessage', '产品用量最多输入14位数字!'); |
| | | this.showErrorToast(component); |
| | | } |
| | | } |
| | | }, |
| | | //工作会记录 |
| | | selectPurposeType: function (component,event,helper) { |
| | | debugger |
| | | var doctor_value = component.find('select_purpose_type').get('v.value'); |
| | | // alert(doctor_value); |
| | | if(doctor_value!='科室会'){ |
| | | component.find('new_con').set('v.disabled', false); |
| | | }else{ |
| | | component.find('new_con').set('v.disabled', true); |
| | | } |
| | | if(doctor_value != ''){ |
| | | this.set_doctor_list(component); |
| | | var action = component.get('c.selectPurposeTypes'); |
| | | action.setParams({ |
| | | 'doctor_value': doctor_value |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.find('select_EffectProgress').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }else{ |
| | | component.find('select_EffectProgress').set('v.options', []); |
| | | } |
| | | }, |
| | | |
| | | selectProductClassification: function (component,event,helper) { |
| | | debugger |
| | | var select_ProductClassification = component.find('select_ProductClassification').get('v.value'); |
| | | if(select_ProductClassification != ''){ |
| | | var action = component.get('c.selectProductClassificationc'); |
| | | action.setParams({ |
| | | "select_ProductClassification": select_ProductClassification |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.find('select_OtherBrandConsumables').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }else{ |
| | | component.find('select_OtherBrandConsumables').set('v.options', []); |
| | | } |
| | | this.selectProductCcategory(component); |
| | | }, |
| | | select_ProductCcategory: function (component,event,helper) { |
| | | var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value'); |
| | | debugger |
| | | if(select_ProductCcategory != ''){ |
| | | var result = component.find('result'); |
| | | var UserProType = component.get('v.UserProType'); |
| | | //fy |
| | | $A.util.removeClass(result, 'disp_none'); |
| | | if(UserProType=='ENG'){ |
| | | $A.util.removeClass(result, 'disp_none'); |
| | | }else{ |
| | | $A.util.addClass(result, 'disp_none'); |
| | | } |
| | | var action = component.get('c.selectProductCcategory01'); |
| | | action.setParams({ |
| | | "select_ProductCcategory": select_ProductCcategory |
| | | }); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | var res = response.getReturnValue(); |
| | | component.find('select_productCategories').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }else{ |
| | | component.find('select_productCategories').set('v.options', []); |
| | | var result = component.find('result'); |
| | | $A.util.addClass(result, 'disp_none'); |
| | | } |
| | | }, |
| | | selectpurposetype : function(component,event,helper){ |
| | | var select_ProductCcategory = component.find('select_ProductCcategory').get('v.value'); |
| | | if (select_ProductCcategory == null && select_ProductCcategory == undefined && select_ProductCcategory == '') { |
| | | var result = component.find('result'); |
| | | // $A.util.removeClass(result, 'disp_none'); |
| | | if(UserProType=='ENG'){ |
| | | $A.util.removeClass(result, 'disp_none'); |
| | | }else{ |
| | | $A.util.addClass(result, 'disp_none'); |
| | | } |
| | | } else { |
| | | debugger |
| | | component.find('select_productCategories').set('v.value', ''); |
| | | var result = component.find('result'); |
| | | $A.util.addClass(result, 'disp_none'); |
| | | this.select_ProductCcategory(component); |
| | | } |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | CallBackAction : function(component,action_name,para,callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.","")); |
| | | if(para){ |
| | | action.setParams(para); |
| | | } |
| | | if(callback){ |
| | | action.setCallback(this,function(data){ |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:application access="public" extends="ltng:outApp" > |
| | | <aura:dependency resource="c:RetrospectiveWeeklyReport"/> |
| | | </aura:application> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <description>A Lightning Application Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:application access="public" extends="ltng:outApp"> |
| | | <aura:dependency resource="c:TenderDeletePageApp"/> |
| | | </aura:application> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <description>A Lightning Application Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:application access="public" extends="ltng:outApp"> |
| | | <aura:dependency resource="c:TenderLostApp"/> |
| | | </aura:application> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <description>A Lightning Application Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| | |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <span id="aa" class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | |
| | | <!-- <force:inputField value="{!v.data.Product_Category3__c}" aura:id="input-product-category3"/> --> |
| | | <ui:inputSelect aura:id="select_Product3" class="slds-select" change="{!c.productcategoryChange3}"/> |
| | | </div> |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start--> |
| | | <!-- 支援需求 --> |
| | | |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start--> |
| | | <!-- 支援需求 change="{!c.SupportNeeds__c}"--> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.SupportNeeds__c} |
| | | <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" /> |
| | | </div> |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end--> |
| | | <div aura:id="result" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | {!v.fieldsmap.Result__c} |
| | |
| | | <br/> |
| | | <div class="save_button_area"> |
| | | <lightning:button class="slds-m-top_small" type="button" label="取消" onclick="{!c.createCancel}"/> |
| | | <lightning:button class="slds-m-top_small" type="submit" label="新建" /> |
| | | <lightning:button class="slds-m-top_small" type="submit" label="保存" /> |
| | | </div> |
| | | </lightning:recordEditForm> |
| | | </div> |
| | |
| | | ({ |
| | | doInit : function(component, event, helper) { |
| | | console.log('zhj 新方案'); |
| | | if (window.location.href.endsWith("weekly-report")) { |
| | | helper.doinit(component, event, helper); |
| | | } else { |
| | |
| | | */ |
| | | |
| | | var agencyHospitalid = component.get('v.hospitalLinkId'); |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | | var data = JSON.stringify(arr); |
| | | // helper.set_aws_url(component,data,agencyHospitalid); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | hospitalId : agencyHospitalid |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | }else{ |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | | var requestData = JSON.stringify(arr); |
| | | // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert'); |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert') + 'V2'; |
| | | |
| | | component.set('v.login',true); |
| | | helper.insert_agencycontact(component,token,newUrl,requestData,agencyHospitalid,helper,hospitalName); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }) |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // var arr = new Array(); |
| | | // arr.push(agencyReport); |
| | | // var data = JSON.stringify(arr); |
| | | // // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | // var token = component.get('v.AWStoken'); |
| | | // var newUrl = component.get('v.AWSinsert'); |
| | | |
| | | component.set('v.login',true); |
| | | helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper); |
| | | // component.set('v.login',true); |
| | | // helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper); |
| | | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | }else{ |
| | |
| | | }, |
| | | |
| | | processFileContent : function(component,event,helper){ |
| | | helper.saveRecords(component,event); |
| | | helper.saveRecords(component,event,helper); |
| | | }, |
| | | |
| | | cancel : function(component,event,helper){ |
| | |
| | | component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c)); |
| | | component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label); |
| | | component.set('v.dialog_type', '新建'); |
| | |
| | | component.set('v.login',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status1 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | b = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status2 : ' + result.status); |
| | | } |
| | | },component); |
| | | }else{ |
| | |
| | | b1 = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status3 : ' + result.status); |
| | | } |
| | | },component); |
| | | }else{ |
| | |
| | | var reports = component.get('v.reports'); |
| | | var Agency_Hospital_text = ''; |
| | | var Agency_Hospital_parent_id = ''; |
| | | |
| | | debugger |
| | | // 医院名 |
| | | if (select_data['Agency_Hospital__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | |
| | | this.set_selected(component, 'select_purpose_type', select_data['Purpose_Type__c']); |
| | | this.select_purpose_type(component); |
| | | } |
| | | |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 |
| | | if (select_data['SupportNeeds__c'] != '') { |
| | | this.set_selected(component, 'SupportNeeds__c', select_data['SupportNeeds__c']); |
| | | } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 結果 |
| | | if (select_data['Result__c'] != '' && typeof select_data['Result__c'] !== "undefined") { |
| | | component.find('select_result').set('v.value', select_data['Result__c']); |
| | |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | | var Product_Category1__c = component.find('select_Product1').get('v.value'); |
| | | var Product_Category2__c = component.find('select_Product2').get('v.value'); |
| | |
| | | !Department_Cateogy__c && |
| | | !doctor2__c && |
| | | !Purpose_Type__c && |
| | | !SupportNeeds__c&&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | !Opportunity__c && |
| | | !Product_Category1__c && |
| | | !Product_Category2__c && |
| | |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['Purpose_Type__c'] == Purpose_Type__c && |
| | | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | select_report_data['Opportunity__c'] == Opportunity__c && |
| | | select_report_data['Product_Category1__c'] == Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == Product_Category2__c && |
| | |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['Purpose_Type__c'] == Purpose_Type__c && |
| | | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | select_report_data['Opportunity__c'] == Opportunity__c && |
| | | select_report_data['Product_Category1__c'] == Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == Product_Category2__c && |
| | |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 SupportNeeds__c |
| | | // var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 询价 Opportunity__c |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // "SupportNeedsc" : SupportNeeds__c, |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // "SupportNeedsc" : SupportNeeds__c, |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | |
| | | component.set('v.doctor_title', ''); |
| | | component.find('select_department').set('v.options', this.conv_selected(component.get('v.allselectlist.Department_Cateogy__c'))); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.Purpose_Type__c'))); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(component.get('v.allselectlist.SupportNeeds__c'))); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | component.find('select_Product1').set('v.value',''); |
| | |
| | | component.set('v.hospitalLinkId', hospital_data[i].Id); |
| | | component.set('v.data.Agency_Hospital__c', hospital_data[i].Id); |
| | | component.find('new_con').set('v.disabled', false); |
| | | //break; |
| | | } |
| | | } |
| | | component.set("v.hospital", accname); |
| | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper) { |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper,hospitalName) { |
| | | |
| | | // AWSService.insert(newUrl,payload,function(result){ |
| | | // if(result.status == '0'){ |
| | |
| | | $A.getCallback(function(){ |
| | | helper.to_agencycontact(component,result,agencyHospitalid); |
| | | })(); |
| | | |
| | | }else{ |
| | | console.log('AWS status error:' + result) |
| | | component.set('v.login',false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | if(result.status == '129'){ |
| | | component.find('OppMessage').setError('该客户人员名字已存在,在'+hospitalName+'医院,请修改'); |
| | | }else{ |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.log('AWS insert error:' + error) |
| | |
| | | var action = component.get('c.saveAgencyContact'); |
| | | action.setParams({ |
| | | "name" : result.object[0].name, |
| | | "nameEncrypt" : result.object[0].nameEncrypt, |
| | | //"nameEncrypt" : result.object[0].nameEncrypt, |
| | | "type" : result.object[0].type, |
| | | "typeEncrypt" : result.object[0].typeEncrypt, |
| | | //"typeEncrypt" : result.object[0].typeEncrypt, |
| | | "doctorDivision1" : result.object[0].doctorDivision1, |
| | | "doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, |
| | | //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, |
| | | "agencyHospitalid" : agencyHospitalid, |
| | | "awsid" : result.object[0].dataId, |
| | | }); |
| | |
| | | if(result.status == '0'){ |
| | | this.to_doctor_list(result,retMap,component); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status4 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | // }); |
| | | }, |
| | | search_core : function(token,searchUrl,payload,callback,component) { |
| | | console.log('token = ' + token); |
| | | console.log('searchUrl = ' + searchUrl); |
| | | console.log('payload = ' + payload); |
| | | fetch(searchUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | |
| | | component.set('v.login',false); |
| | | if(callback)callback(result); |
| | | }).catch(error => { |
| | | console.log('error = ' + JSON.stringify(error)); |
| | | this.error('AWS search error.'); |
| | | component.set('v.login',false); |
| | | }); |
| | |
| | | // }, |
| | | |
| | | opportunityChange : function(component, event, helper) { |
| | | debugger |
| | | var opp_id = component.get('v.data.Opportunity__c'); |
| | | if (opp_id == '') { |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | |
| | | // } |
| | | component.set('v.login',false); |
| | | return false; |
| | | } else if (res[0]['StageName2__c'] != '3.询价' && !component.get('v.loadOpp')){ |
| | | this.warning('请选择询价中的项目'); |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // } else { |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | component.set('v.login',false); |
| | | return false; |
| | | } else { |
| | | } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy start |
| | | // else if (res[0]['StageName2__c'] != '3.询价' && !component.get('v.loadOpp')){ |
| | | // this.warning('请选择询价中的项目'); |
| | | // // ToDo需要测试手机上能运行不 |
| | | // component.set('v.data.Opportunity__c', ''); |
| | | // $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | // $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | // $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | // $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | // $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | // // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // // var values = []; |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // // } else { |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // // } |
| | | // component.set('v.login',false); |
| | | // return false; |
| | | // } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy end |
| | | else { |
| | | component.set('v.loadOpp', false); |
| | | component.set('v.oppdata',res[0]); |
| | | this.set_selected(component, 'select_stageName', res[0].StageName__c); |
| | |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | }, |
| | | setOpportunity_cfilter : function(component) { |
| | | debugger |
| | | var hosId = component.get('v.hospitalId'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var opportunity_cfilter = ''; |
| | |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | |
| | | saveRecords : function(component,event){ |
| | | saveRecords : function(component,event,helper){ |
| | | component.set('v.login',true); |
| | | var action = component.get("c.processData"); |
| | | var selectDate = component.find('select_date').get('v.value'); |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | var sss=component.get("v.fileContentData"); |
| | | action.setParams({ |
| | | //fy 导入 20220424 start |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | action1.setParams({ |
| | | fileData : component.get("v.fileContentData"), |
| | | //selectDateselectDate :component.find('select_date').get('v.value'), |
| | | sobjectName:'Account', //Any object |
| | | fields:fieldsList |
| | | |
| | | |
| | | }); |
| | | action.setCallback(this, function(response) { |
| | | }); |
| | | action1.setCallback(this, function(response) { |
| | | console.log('response = ' + JSON.stringify(response)); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | console.log("[[[[[["+res); |
| | | if(res != 'success'){ |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | for (var i=0; i<ress.length; i++) { |
| | | res1 += ress[i].substr(7)+'\n'; |
| | | var ress = response.getReturnValue(); |
| | | console.log('ress = ' + JSON.stringify(ress)); |
| | | if(ress){ |
| | | var valur =ress.split('error1'); |
| | | if(valur.length<=1){ |
| | | var res = JSON.parse(response.getReturnValue()); |
| | | console.log('res = ' + JSON.stringify(res)); |
| | | var dataArr = new Array(); |
| | | var dataMap = new Map(); |
| | | res.forEach(item => { |
| | | if(item.AWS_Data_Id__c){ |
| | | dataArr.push(item.AWS_Data_Id__c); |
| | | //dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c); |
| | | dataMap.set(item.AWS_Data_Id__c,item.AWS_Data_Id__c); //zhj 新方案改造 2022-12-21 |
| | | } |
| | | }); |
| | | debugger |
| | | let obj= Object.create(null); |
| | | obj['dataIds'] = dataArr; |
| | | var payload = JSON.stringify(obj); |
| | | this.search_contact_url(component, 'Agency_Contact__c', (result)=>{ |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | if(result.status == '0'){ |
| | | if(result.object != null&&result.object.length != 0){ |
| | | // var resultjson = JSON.stringify(result.object); |
| | | // if(resultjson){ |
| | | // debugger |
| | | // console.warn('001'); |
| | | // component.set('v.login',true); |
| | | // this.ImportMethod(component,resultjson); |
| | | // } |
| | | component.set('v.login',true); |
| | | this.saveRecordsEditFile(component,dataMap,result.object,helper); |
| | | }else{ |
| | | this.error('AWS search status5 ' ); |
| | | component.set('v.login',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status6 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | | // var resultjson =null; |
| | | // this.ImportMethod(component,resultjson); |
| | | |
| | | }); |
| | | // var resultjson =null; |
| | | // this.ImportMethod(component,resultjson); |
| | | }else{ |
| | | this.error(valur[1]+'\n'+"请修改后重新上传"); |
| | | } |
| | | // $('.forceToastManager').css('white-space', 'pre-wrap'); |
| | | console.log("=="+res1); |
| | | this.error(res1+"请修改后重新上传"); |
| | | component.set('v.login',false); |
| | | }else{ |
| | | component.set("v.showMain",true); |
| | | this.success("导入成功"); |
| | | // alert('saved successfully'); |
| | | component.set('v.login',false); |
| | | } |
| | | |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | // do something |
| | | component.set('v.login',false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | component.set('v.login',false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set('v.login',false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | $A.enqueueAction(action1); |
| | | //fy 导入 20220424 end |
| | | // var action = component.get("c.processData"); |
| | | // var selectDate = component.find('select_date').get('v.value'); |
| | | // var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | // var sss=component.get("v.fileContentData"); |
| | | // action.setParams({ |
| | | // fileData : component.get("v.fileContentData"), |
| | | // //selectDateselectDate :component.find('select_date').get('v.value'), |
| | | // sobjectName:'Account', //Any object |
| | | // fields:fieldsList |
| | | // }); |
| | | // action.setCallback(this, function(response) { |
| | | // var state = response.getState(); |
| | | // if (state === "SUCCESS") { |
| | | |
| | | // var res = response.getReturnValue(); |
| | | // var res1 = ''; |
| | | // console.log("[[[[[["+res); |
| | | // if(res != 'success'){ |
| | | // debugger |
| | | // var ress = res.split('='); |
| | | // console.log(ress); |
| | | // for (var i=0; i<ress.length; i++) { |
| | | // res1 += ress[i].substr(7)+'\n'; |
| | | // } |
| | | // // $('.forceToastManager').css('white-space', 'pre-wrap'); |
| | | // console.log("=="+res1); |
| | | // this.error(res1+"请修改后重新上传"); |
| | | // component.set('v.login',false); |
| | | // }else{ |
| | | // component.set("v.showMain",true); |
| | | // this.success("导入成功"); |
| | | // // alert('saved successfully'); |
| | | // component.set('v.login',false); |
| | | // } |
| | | |
| | | // } |
| | | // else if (state === "INCOMPLETE") { |
| | | // // do something |
| | | // component.set('v.login',false); |
| | | // } |
| | | // else if (state === "ERROR") { |
| | | // var errors = response.getError(); |
| | | // if (errors) { |
| | | // if (errors[0] && errors[0].message) { |
| | | // console.log("Error message: " + |
| | | // errors[0].message); |
| | | // component.set('v.login',false); |
| | | // } |
| | | // } else { |
| | | // console.log("Unknown error"); |
| | | // component.set('v.login',false); |
| | | // } |
| | | // } |
| | | // }); |
| | | // $A.enqueueAction(action); |
| | | |
| | | }, |
| | | },ImportMethod : function(component,fileStr){ |
| | | var actionss = component.get("c.processData"); |
| | | var selectDate = component.find('select_date').get('v.value'); |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | var sss=component.get("v.fileContentData"); |
| | | actionss.setParams({ |
| | | // fileData : component.get("v.fileContentData"), |
| | | fileData : fileStr, |
| | | // selectDateselectDate :component.find('select_date').get('v.value'), |
| | | sobjectName:'Account', //Any object |
| | | fields:fieldsList |
| | | // Agency_ContactListjson:resultjson |
| | | }); |
| | | actionss.setCallback(this, function(response) { |
| | | console.log('002'); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | console.log("[[[[[["+res); |
| | | if(res != 'success'){ |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | for (var i=0; i<ress.length; i++) { |
| | | res1 += ress[i].substr(7)+'\n'; |
| | | } |
| | | // $('.forceToastManager').css('white-space', 'pre-wrap'); |
| | | console.log("=="+res1); |
| | | this.error(res1+"请修改后重新上传"); |
| | | component.set('v.login',false); |
| | | }else{ |
| | | component.set("v.showMain",true); |
| | | this.success("导入成功"); |
| | | // alert('saved successfully'); |
| | | component.set('v.login',false); |
| | | } |
| | | |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | // do something |
| | | component.set('v.login',false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | component.set('v.login',false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set('v.login',false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(actionss); |
| | | },saveRecordsEditFile : function(component,dataMap,searchData,helper){ |
| | | var searchDataMap = new Map(); |
| | | for (var i = 0; i < searchData.length; i++) { |
| | | var sd = searchData[i]; |
| | | if(sd.name) |
| | | searchDataMap.set(sd.name.replace(' ',''),sd.dataId); |
| | | } |
| | | console.log('searchDataMap='+searchDataMap); |
| | | var error = ''; |
| | | var fileData = component.get("v.fileContentData"); |
| | | var files = fileData.split('\n'); |
| | | |
| | | var fileStr = files[0]; |
| | | fileStr += '\n'; |
| | | |
| | | for (var i = 1; i < files.length-1; i++) { |
| | | var filelist = files[i].split(','); |
| | | var fileName = filelist[4]; |
| | | |
| | | if (searchDataMap.get(fileName.replace(' ',''))) { |
| | | var nameDataId = searchDataMap.get(fileName.replace(' ','')); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[4] = dataMap.get(nameDataId); //zhj 新方案改造 filelist[4]不再存的nameEncrpt 2022-12-21 |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人SF不存在'; |
| | | error += '='; |
| | | } |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人AWS不存在'; |
| | | error += '='; |
| | | } |
| | | fileStr += filelist.toString(); |
| | | fileStr += '\n'; |
| | | } |
| | | |
| | | if (error != '') { |
| | | this.error(error); |
| | | console.log('error='+error); |
| | | component.set('v.login',false); |
| | | return; |
| | | } |
| | | |
| | | console.log('fileStr='+fileStr); |
| | | $A.getCallback(function(){ |
| | | debugger |
| | | helper.ImportMethod(component,fileStr); |
| | | })(); |
| | | |
| | | }, |
| | | convertArrayOfObjectsToCSV : function(component,objectRecords){ |
| | | var csvStringResult, counter, keys, columnDivider, lineDivider,thkeys; |
| | | if (objectRecords == null || !objectRecords.length) { |
| | |
| | | columnDivider = ','; |
| | | lineDivider = '\n'; |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c']; |
| | | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果'] |
| | | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | csvStringResult = ''; |
| | | csvStringResult += thkeys.join(columnDivider); |
| | | csvStringResult += lineDivider; |
| | |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"'; |
| | | } |
| | | // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; |
| | | // } |
| | | else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; |
| | | } |
| | | else{ |
| | | csvStringResult += '"'+ objectRecords[i][skey]+'"'; |
| | | } |
| | |
| | | }, |
| | | showExportDate : function(component,objectRecords){ |
| | | console.log('进入showexceportdate'+objectRecords);//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c']; |
| | | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果'] |
| | | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | for(i=0;i<headers.length; i++){ |
| | |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>'; |
| | | } |
| | | // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; |
| | | // } |
| | | else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; |
| | | } |
| | | else{ |
| | | content += '<td>'+ objectRecords[i][skey]+'</td>'; |
| | | } |
| | |
| | | var modalimportbg = component.find('modal_exportbg'); |
| | | $A.util.addClass(modalimport, 'disp_none'); |
| | | $A.util.addClass(modalimportbg,'disp_none'); |
| | | } |
| | | |
| | | }, |
| | | |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | CallBackAction : function(component,action_name,para,callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.","")); |
| | | if(para){ |
| | | action.setParams(para); |
| | | } |
| | | if(callback){ |
| | | action.setCallback(this,function(data){ |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | |
| | | // searchAgencyContact : function(res) { |
| | | // var agencyContacts = []; |
| | | // for (let idx = 0; idx < res.length; idx++) { |
| | |
| | | |
| | | |
| | | </th> |
| | | <!-- 第七列 附件名 fy--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="附件名1" scope="row" style="width: 110px;height: 35px;"> |
| | | |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="附件名1" class="slds-truncate" style="padding-bottom: 3px;">附件名1</span> |
| | | |
| | | |
| | | </div> |
| | | </span> |
| | | |
| | | |
| | | |
| | | </th> |
| | | <!-- 第七列 二维码 --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="医院签收二维码" scope="row" style="width: 140px;height: 35px;text-align: center;"> |
| | | |
| | |
| | | |
| | | |
| | | </th> |
| | | <!-- 行项目 第四列 附件名 fy--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="附件名1" scope="row"> |
| | | |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <!-- <lightning:formattedText value="{!curr.AttachmentName}" /> --> |
| | | <a href="https://sfpi-mebg-test.olympuschina.com:8081/stg/api/file/preview?key=20220419/8cf583ab71c94eee96da7bbfcc1b376b.html">附件名1</a> |
| | | <!-- <a href="https://ocsm stagefull.sandbox.file.force.com/servlet/servlet.FileDownload?file=00P1000001QkhvQ">{!curr.AttachmentName}</a> --> |
| | | |
| | | </div> |
| | | </span> |
| | | |
| | | |
| | | |
| | | </th> |
| | | <!-- 行项目 第七列 医院签收二维码--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="" scope="row" style="text-align: center;"> |
| | | |
| | | <button id="{!curr.skip_Hospital_Sign__c}" tabindex="-1" class="slds-button ReturnButton" name="{!curr.DNNameNo0__c}" style="width: 40px;" value="{!curr.agencySignUpDate__c}" onclick="{!c.showESignQR}">查看</button> |
| | | <button id="{!curr.skip_Hospital_Sign__c}" tabindex="-1" class="slds-button ReturnButton" name="{!curr.DNNameNo0__c}" style="width: 40px;" value="{!IF(curr.skip_Distribution_Sign__c, 'true', curr.agencySignUpDate__c)}" onclick="{!c.showESignQR}">查看</button> |
| | | |
| | | |
| | | </th> |
| | |
| | | ({ |
| | | init: function(cmp, event) { |
| | | |
| | | debugger; |
| | | // 创建Base64对象 |
| | | var Base64 = { |
| | | _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", |
| | |
| | | //如果签收单录入表有数据,先取录入表的否则就检索签收单信息 |
| | | var result; |
| | | //存放录入表list |
| | | var eSignFormEntryList; |
| | | var eSignFormEntryList=[]; |
| | | //存放签收单list |
| | | var eSignFormList; |
| | | var eSignFormList=[]; |
| | | //fy 20220727 start |
| | | //存放附件名 |
| | | var AttachmentMap = new Map(); |
| | | //fy 20220727 end |
| | | if (res) { |
| | | if (res.eSignFormEntryList != null) { |
| | | if (res.eSignFormEntryList != undefined) { |
| | | eSignFormEntryList = res.eSignFormEntryList; |
| | | } |
| | | if (res.eSignFormList != null) { |
| | | if (res.eSignFormList != undefined) { |
| | | eSignFormList = res.eSignFormList; |
| | | } |
| | | //fy 20220727 start |
| | | if (res.AttachmentStringList!=undefined) { |
| | | for(var i = 0; i < res.AttachmentStringList.length; i++){ |
| | | var liststr=[]; |
| | | liststr=res.AttachmentStringList[i].split('_'); |
| | | if(liststr.length>0){ |
| | | AttachmentMap.set(liststr[0],liststr[1]); |
| | | } |
| | | } |
| | | } |
| | | //fy 20220727 end |
| | | var today = this.getNowFormatDate(); |
| | | if (eSignFormEntryList) { |
| | | for (var i = 0; i < eSignFormList.length; i++) { |
| | |
| | | } |
| | | |
| | | var pageSize = cmp.get('v.pageSize'); |
| | | //fy 20220727 start |
| | | debugger |
| | | if(res){ |
| | | if(AttachmentMap.size>0){ |
| | | for(var i = 0; i < result.length; i++){ |
| | | if(AttachmentMap.has(result[i].Id)){ |
| | | result[i].AttachmentName=AttachmentMap.get(result[i].Id); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //fy 20220727 end |
| | | cmp.set("v.data", result); |
| | | var data = result; |
| | | cmp.set("v.lineItemSize", data.length); |
| | |
| | | $A.util.addClass(spinner, "slds-hide"); |
| | | }, |
| | | getURLParameterValue: function() { |
| | | |
| | | var querystring = location.search.substr(1); |
| | | debugger; |
| | | var querystring = window.location.search.substr(1); |
| | | var paramValue = {}; |
| | | querystring.split("&").forEach(function(part) { |
| | | var param = part.split("="); |
| | |
| | | }, |
| | | getURLISTrueParameter: function() { |
| | | |
| | | var url = location.search; |
| | | var url = window.location.search; |
| | | var flag; |
| | | if (url.indexOf("?") != -1) { |
| | | flag = true; |
| | |
| | | </div> |
| | | </aura:if> |
| | | <br/> |
| | | <button class="slds-button slds-button_brand" onclick="{!c.doSave}">2.选择附件</button> |
| | | <button class="slds-button slds-button_brand" onclick="{!c.doSave}">2.上传附件</button> |
| | | <lightning:accordion allowMultipleSectionsOpen="true" onsectiontoggle="{! c.handleSectionToggle }" activeSectionName="{! v.activeSections }"> |
| | | <lightning:accordionSection name="A" label="文件列表"> |
| | | <!-- 增加小色块 精琢技术 thh 2021-09-26 start --> |
| | |
| | | }, |
| | | //wangweipeng 获取url的参数 2021/09/27 start |
| | | getURLParameterValue: function() { |
| | | var querystring = location.search.substr(1); |
| | | var querystring = window.location.search.substr(1); |
| | | var paramValue = {}; |
| | | querystring.split("&").forEach(function(part) { |
| | | var param = part.split("="); |
| | |
| | | }, |
| | | //wangweipeng 获取url的参数 2021/09/27 start |
| | | getURLParameterValue: function() { |
| | | var querystring = location.search.substr(1); |
| | | var querystring = window.location.search.substr(1); |
| | | var paramValue = {}; |
| | | querystring.split("&").forEach(function(part) { |
| | | var param = part.split("="); |
| New file |
| | |
| | | global class ASOTDeleteRealBatch implements Database.Batchable<sObject>,Database.Stateful { |
| | | public String query; |
| | | private BatchIF_Log__c iflog; |
| | | global ASOTDeleteRealBatch() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | system.debug('执行start'); |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'PushNotification'; |
| | | iflog.Log__c = 'CoverageTargetHPBatch start\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | | |
| | | query = 'select id,Renew_Finish_Else__c,Renew_Finish_Correlation_Lightsource__c,Renew_Finish_Rigid_Mirror_3__c,Renew_Finish_Rigid_Mirror_1__c,' |
| | | +' Finish_Correlation_Lightsource__c,Finish_Rigid_Mirror_2__c,Finish_Rigid_Mirror_1__c ' |
| | | +' from Account_Service_Of_Target__c ' |
| | | +' where (Finish_Asset__c!=0 and Finish_Asset__c!=null) or (Finish_Coverage_Asset__c != 0 and Finish_Coverage_Asset__c!=null)'; |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Account_Service_Of_Target__c> asotList) { |
| | | List<Account_Service_Of_Target__c> asotL = new List<Account_Service_Of_Target__c>(); |
| | | // 清空客户-目标的实际设备数 |
| | | for (Account_Service_Of_Target__c asot : asotList) { |
| | | asot.Renew_Finish_Else__c = 0; |
| | | asot.Renew_Finish_Correlation_Lightsource__c = 0; |
| | | asot.Renew_Finish_Rigid_Mirror_3__c = 0; |
| | | asot.Renew_Finish_Rigid_Mirror_1__c = 0; |
| | | asot.Finish_Correlation_Lightsource__c = 0; |
| | | asot.Finish_Rigid_Mirror_2__c = 0; |
| | | asot.Finish_Rigid_Mirror_1__c = 0; |
| | | asotL.add(asot); |
| | | } |
| | | update asotL; |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | iflog.Log__c += '\nASOTDeleteRealBatch end'; |
| | | String tmp = iflog.ErrorLog__c; |
| | | if (tmp.length() > 65000) { |
| | | tmp = tmp.substring(0, 65000); |
| | | tmp += ' ...have more lines...'; |
| | | iflog.ErrorLog__c = tmp; |
| | | } |
| | | update iflog; |
| | | EquipmentRealCoverageRealBatch batch1 = new EquipmentRealCoverageRealBatch(); |
| | | Database.executeBatch(batch1); |
| | | EquipmentRenewMoleculeBatch batch2 = new EquipmentRenewMoleculeBatch(); |
| | | Database.executeBatch(batch2); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class ASOTDeleteRealBatchTest { |
| | | static testMethod void testMethod1() { |
| | | ASOTDeleteRealBatch batch3 = new ASOTDeleteRealBatch(); |
| | | Database.executeBatch(batch3,200); |
| | | } |
| | | @testSetup |
| | | private static void setUpDate(){ |
| | | List<Account_Service_Of_Target__c> asotL = new List<Account_Service_Of_Target__c>(); |
| | | |
| | | Date toDayTime = Date.today(); |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'hospitalabc'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.Attribute_Type__c = '卫生部'; |
| | | hospital.Speciality_Type__c = '综合医院'; |
| | | hospital.Grade__c = '一级'; |
| | | hospital.IF_Coverage_Target_HP__c = '1'; |
| | | hospital.OCM_Category__c = 'SLTV'; |
| | | hospital.Is_Medical__c = '医疗机构'; |
| | | hospital.Town__c = '东京'; |
| | | Oly_TriggerHandler.bypass('NFM701ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | insert hospital; |
| | | |
| | | Account_Service_Of_Target__c asot1 = new Account_Service_Of_Target__c(); |
| | | asot1.Renew_Finish_Else__c = 10; |
| | | asot1.Renew_Finish_Correlation_Lightsource__c = 10; |
| | | asot1.Renew_Finish_Rigid_Mirror_3__c = 10; |
| | | asot1.Renew_Finish_Rigid_Mirror_1__c = 10; |
| | | asot1.Finish_Correlation_Lightsource__c = 10; |
| | | asot1.Finish_Rigid_Mirror_2__c = 10; |
| | | asot1.Finish_Rigid_Mirror_1__c = 10; |
| | | asot1.Account_HP__c=hospital.Id; |
| | | asotL.add(asot1); |
| | | |
| | | Account_Service_Of_Target__c asot2 = new Account_Service_Of_Target__c(); |
| | | asot2.Renew_Finish_Else__c = 10; |
| | | asot2.Renew_Finish_Correlation_Lightsource__c = 10; |
| | | asot2.Renew_Finish_Rigid_Mirror_3__c = 10; |
| | | asot2.Renew_Finish_Rigid_Mirror_1__c = 10; |
| | | asot2.Finish_Correlation_Lightsource__c = 10; |
| | | asot2.Finish_Rigid_Mirror_2__c = 10; |
| | | asot2.Finish_Rigid_Mirror_1__c = 10; |
| | | asot2.Account_HP__c=hospital.Id; |
| | | asotL.add(asot2); |
| | | |
| | | Account_Service_Of_Target__c asot3 = new Account_Service_Of_Target__c(); |
| | | asot3.Renew_Finish_Else__c = 10; |
| | | asot3.Renew_Finish_Correlation_Lightsource__c = 10; |
| | | asot3.Renew_Finish_Rigid_Mirror_3__c = 10; |
| | | asot3.Renew_Finish_Rigid_Mirror_1__c = 10; |
| | | asot3.Finish_Correlation_Lightsource__c = 10; |
| | | asot3.Finish_Rigid_Mirror_2__c = 10; |
| | | asot3.Finish_Rigid_Mirror_1__c = 10; |
| | | asot3.Account_HP__c=hospital.Id; |
| | | asotL.add(asot3); |
| | | insert asotL; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public without sharing class AWSServiceTool2 { |
| | | |
| | | static Map<string,PIHelper.PIIntegration> staticResourceBuffer = new Map<string,PIHelper.PIIntegration>(); |
| | | static PIHelper.PIIntegration getPIIntegration(string sobject_name){ |
| | | system.debug('sobject_name='+sobject_name); |
| | | if(!staticResourceBuffer.containsKey(sobject_name)){ |
| | | PIHelper.PIIntegration staticResource = PIHelper.getPIIntegrationInfo(sobject_name); |
| | | staticResourceBuffer.put(sobject_name,staticResource); |
| | | } |
| | | return staticResourceBuffer.get(sobject_name); |
| | | } |
| | | |
| | | public static boolean EncryptPushData(List<string> Ids){ |
| | | if(ids == null || ids.size() == 0){ |
| | | return false; |
| | | } |
| | | |
| | | Id rid = Ids[0]; |
| | | string sobject_name = rid.getSobjectType().getDescribe().getName(); |
| | | string sql = 'select id '; |
| | | |
| | | PIHelper.PIIntegration staticResource = getPIIntegration(sobject_name); |
| | | for(PI_Field_Policy_Detail__c detail :staticResource.PIDetails){ |
| | | sql += ',' + detail.SF_Field_API_Name__c+',' + detail.SF_Field_Encrypted_API__c; |
| | | } |
| | | sql += ' ,AWS_Data_Id__c from ' + sobject_name + ' where id in :Ids'; |
| | | system.debug('sql='+sql); |
| | | List<Sobject> lso = Database.query(sql); |
| | | system.debug('lso.size()='+lso.size()); |
| | | if(lso.size()==0){ |
| | | return false; |
| | | } |
| | | return EncryptPushCore(Json.serialize(lso),sobject_name); |
| | | } |
| | | |
| | | @future(callout=true) |
| | | public static void EncryptPushFuture(string json_list,string sobject_name){ |
| | | EncryptPushCore(json_list,sobject_name); |
| | | } |
| | | |
| | | // List<Rental_Apply__c> temps = [select id,AWS_Data_Id__c,name, direct_shippment_address__c, Direct_Shippment_Address_Encrypt__c, Phone_number__c, Phone_Number_Encrypt__c,CreatedDate from Rental_Apply__c where AWS_Data_Id__c != null order by CreatedDate desc limit 2]; |
| | | public static boolean EncryptPushCore(string json_list,string sobject_name){ |
| | | system.debug('enter EncryptPushCore'); |
| | | if(string.isBlank(json_list) || string.isBlank(sobject_name)){ |
| | | |
| | | system.debug('json_list or sobject_name is null'); |
| | | return false; |
| | | } |
| | | |
| | | //调用滨璜接口更新 |
| | | PIHelper.PIIntegration staticResource = getPIIntegration(sobject_name); |
| | | system.debug('staticResource.token='+staticResource.token); |
| | | if(String.isBlank(staticResource.token)){ |
| | | System.debug('获取aws token 失败'); |
| | | return false; |
| | | } |
| | | List<object> newobjectList = (List<object>)Json.deserializeUntyped(json_list); |
| | | Map<Id,Sobject> newMap = new Map<Id,Sobject>(); |
| | | |
| | | for(object obj : newobjectList){ |
| | | Map<string,object> mobj = (Map<string,object>)obj; |
| | | if(mobj.containsKey('Id')){ |
| | | Sobject sobj_temp = (Sobject)Json.deserialize(Json.serialize(obj), Type.forName(sobject_name)); |
| | | newMap.put(sobj_temp.Id,sobj_temp); |
| | | } |
| | | } |
| | | List<Map<string,object>> insert_list = new List<Map<string,object>>(); |
| | | List<Map<string,object>> update_list = new List<Map<string,object>>(); |
| | | List<sobject> newList = newMap.values(); |
| | | for(Sobject ra : newList){ |
| | | Map<string,object> mso = new Map<string,object>(); |
| | | |
| | | |
| | | for(PI_Field_Policy_Detail__c detail : staticResource.PIDetails){ |
| | | if(ra.isSet(detail.SF_Field_API_Name__c)){ |
| | | mso.put(detail.AWS_Field_API__c,ra.get(detail.SF_Field_API_Name__c)); |
| | | mso.put(detail.AWS_Encrypted_Field_API__c,ra.get(detail.SF_Field_Encrypted_API__c)); |
| | | } |
| | | } |
| | | mso.put('sfRecordId',ra.Id); |
| | | string aws_id = string.valueOf(ra.get('AWS_Data_Id__c')); |
| | | system.debug('aws_id='+aws_id); |
| | | if(string.isBlank(aws_id)){ |
| | | insert_list.add(mso); |
| | | }else{ |
| | | system.debug('aws_id.lenth='+aws_id.length()); |
| | | mso.put('dataId',aws_id); |
| | | update_list.add(mso); |
| | | } |
| | | |
| | | } |
| | | List<object> objList = new List<object>(); |
| | | List<Sobject> updateList = new List<Sobject>(); |
| | | List<object> temp = null; |
| | | system.debug('insert_list.size()='+insert_list.size()); |
| | | system.debug('update_list.size()='+update_list.size()); |
| | | //if(true)return; |
| | | if(insert_list.size() > 0){ |
| | | system.debug('url='+staticResource.newEncryptUrl); |
| | | temp = PostAws(Json.serialize(insert_list),staticResource.newEncryptUrl,staticResource.token); |
| | | if(temp != null){ |
| | | objList.addAll(temp); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(update_list.size() > 0){ |
| | | system.debug('url='+staticResource.updateEncryptUrl); |
| | | temp = PostAws(Json.serialize(update_list),staticResource.updateEncryptUrl,staticResource.token); |
| | | if(temp != null){ |
| | | objList.addAll(temp); |
| | | } |
| | | } |
| | | |
| | | system.debug('objList.size()='+objList.size()); |
| | | if(objList.size()==0){ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | for(object obj : objList){ |
| | | Map<string,object> obj_map = (Map<string,object>)obj; |
| | | string sfRecordId = null; |
| | | string dataId = null; |
| | | if(obj_map.containsKey('sfRecordId')){ |
| | | sfRecordId = string.valueOf(obj_map.get('sfRecordId')); |
| | | }else{ |
| | | system.debug('obj_map.containsKey(\'sfRecordId\')='+obj_map.containsKey('sfRecordId')); |
| | | continue; |
| | | } |
| | | |
| | | if(obj_map.containsKey('dataId')){ |
| | | dataId = string.valueOf(obj_map.get('dataId')); |
| | | }else{ |
| | | system.debug('obj_map.containsKey(\'dataId\')='+obj_map.containsKey('dataId')); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | if(newMap.containsKey(sfRecordId)){ |
| | | Sobject ra = newMap.get(sfRecordId); |
| | | for(PI_Field_Policy_Detail__c detail : staticResource.PIDetails){ |
| | | if(obj_map.containsKey(detail.AWS_Field_API__c)){ |
| | | ra.put(detail.SF_Field_API_Name__c,obj_map.get(detail.AWS_Field_API__c)); |
| | | }else{ |
| | | system.debug('detail.AWS_Field_API__c='+detail.AWS_Field_API__c+' not in obj_map'); |
| | | } |
| | | |
| | | if(obj_map.containsKey(detail.AWS_Encrypted_Field_API__c)){ |
| | | ra.put(detail.SF_Field_Encrypted_API__c,obj_map.get(detail.AWS_Encrypted_Field_API__c)); |
| | | }else{ |
| | | system.debug('detail.AWS_Encrypted_Field_API__c='+detail.AWS_Encrypted_Field_API__c+' not in obj_map'); |
| | | } |
| | | } |
| | | ra.put('AWS_Data_Id__c',dataId); |
| | | |
| | | updateList.add(ra); |
| | | }else{ |
| | | system.debug('newMap.containsKey('+sfRecordId+')='+newMap.containsKey(sfRecordId)); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | system.debug('updateList.size='+updateList.size()); |
| | | if(updateList.size()>0){ |
| | | update updateList; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | static List<object> PostAws(string payload,string url,string token){ |
| | | system.debug('payload='+payload); |
| | | NFMUtil.response response = NFMUtil.sendToPiAWS(payload, url,token); |
| | | system.debug(response); |
| | | Map<string,object> res_obj = (Map<string,object>)Json.deserializeUntyped(response.responseBody); |
| | | if(res_obj == null || !res_obj.containsKey('object') ){ |
| | | System.debug('res_obj == null || !res_obj.containsKey(\'object\')'); |
| | | return null; |
| | | } |
| | | |
| | | List<object> objList = (List<object>)res_obj.get('object'); |
| | | if(objList == null){ |
| | | System.debug('objList == null'); |
| | | return null; |
| | | } |
| | | return objList; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public class AWSServiceTool2Test { |
| | | |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'}); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test1(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | AWSServiceTool2.EncryptPushFuture(null,null); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test2(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | Aws_Data_Id__c = '123456' |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test3(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | |
| | | Test.startTest(); |
| | | AWSServiceTool2.EncryptPushData(new string[]{'0031000000O4Cff'}); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | |
| | | /* |
| | | @isTest |
| | | static void Test3(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | Rental_Apply__c ra = new Rental_Apply__c(); |
| | | insert ra; |
| | | //PIHelper.getPIIntegrationInfo('Rental_Apply__c'); |
| | | List<Rental_Apply__c> lra = new List<Rental_Apply__c>(); |
| | | lra.add(new Rental_Apply__c( |
| | | Old_Rental_Apply__c = ra.Id |
| | | )); |
| | | //insert lra; |
| | | Test.startTest(); |
| | | AWSServiceTool2.decryptInsertCore(Json.serialize(lra),'Rental_Apply__c'); |
| | | Test.stopTest(); |
| | | }*/ |
| | | |
| | | |
| | | |
| | | class HttpMock implements HttpCalloutMock{ |
| | | |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | if(request.getEndpoint().contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | // } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | //zhj MEBG新方案改造 2022-11-27 |
| | | global without sharing class AWSServiceTool2V2 { |
| | | |
| | | public static Map<String,String> matchupMap; |
| | | |
| | | public static void assignmentMatchupMap() { |
| | | //map的键对应医院表上ocsm管理省值 |
| | | //map的值对应地址表上类型为办事处的 省+','+市 |
| | | matchupMap = new Map<String,String>(); |
| | | matchupMap.put('黑龙江','黑龙江,哈尔滨市'); |
| | | matchupMap.put('青海','青海省,西宁市'); |
| | | matchupMap.put('陕西','陕西省,西安市'); |
| | | matchupMap.put('重庆','重庆市,渝中区'); |
| | | matchupMap.put('贵州','贵州省,贵阳市'); |
| | | matchupMap.put('福建','福建省,福州市'); |
| | | matchupMap.put('甘肃','甘肃省,兰州市'); |
| | | matchupMap.put('湖南','湖南省,长沙市'); |
| | | matchupMap.put('湖北','湖北省,武汉市'); |
| | | matchupMap.put('深圳','广东省,深圳市'); |
| | | matchupMap.put('广东','广东省,广州市'); |
| | | //matchupMap.put('海南','');//没有 |
| | | matchupMap.put('浙江','浙江省,杭州市'); |
| | | matchupMap.put('河南','河南省,郑州市'); |
| | | matchupMap.put('河北','河北省,石家庄市'); |
| | | matchupMap.put('沈阳','辽宁省,沈阳市'); |
| | | matchupMap.put('大连','辽宁省,大连市'); |
| | | matchupMap.put('江西','江西省,南昌市'); |
| | | matchupMap.put('江苏','江苏省,南京市'); |
| | | matchupMap.put('新疆','新疆维吾尔自治区,乌鲁木齐市'); |
| | | matchupMap.put('广西','广西自治区,南宁市'); |
| | | matchupMap.put('山西','山西省,太原市'); |
| | | matchupMap.put('山东,济南市','山东省,济南市'); |
| | | matchupMap.put('山东,青岛市','山东省,青岛市'); |
| | | matchupMap.put('安徽','安徽省,合肥市'); |
| | | matchupMap.put('宁夏','宁夏回族自治区,银川市'); |
| | | matchupMap.put('天津','天津市,河西区'); |
| | | matchupMap.put('四川/西藏','四川省,成都市'); |
| | | matchupMap.put('吉林','吉林省,长春市'); |
| | | matchupMap.put('北京','北京市,朝阳区'); |
| | | matchupMap.put('内蒙古','内蒙古自治区,呼和浩特市'); |
| | | matchupMap.put('云南','云南省,昆明市'); |
| | | //add wangweipeng 2021/12/27 start |
| | | matchupMap.put('上海','上海市,徐汇区'); |
| | | //add wangweipeng 2021/12/27 end |
| | | } |
| | | |
| | | |
| | | static Map<string,PIHelper.PIIntegration> staticResourceBuffer = new Map<string,PIHelper.PIIntegration>(); |
| | | static PIHelper.PIIntegration getPIIntegration(string sobject_name){ |
| | | system.debug('sobject_name='+sobject_name); |
| | | if(!staticResourceBuffer.containsKey(sobject_name)){ |
| | | PIHelper.PIIntegration staticResource = PIHelper.getPIIntegrationInfo(sobject_name); |
| | | staticResourceBuffer.put(sobject_name,staticResource); |
| | | } |
| | | return staticResourceBuffer.get(sobject_name); |
| | | } |
| | | |
| | | |
| | | //修理的 |
| | | public static boolean EncryptPushDataRepair(String rid){ |
| | | if(String.isBlank(rid)){ |
| | | return false; |
| | | } |
| | | assignmentMatchupMap(); |
| | | System.debug('matchupMap = ' + matchupMap); |
| | | Map<String,PIHelper.PIIntegration> staticResource = new Map<String,PIHelper.PIIntegration>(); |
| | | staticResource.put('Repair__c',PIHelper.getPIIntegrationInfo('Repair__c')); |
| | | staticResource.put('Contact',PIHelper.getPIIntegrationInfo('Contact')); |
| | | staticResource.put('Address__c',PIHelper.getPIIntegrationInfo('Address__c')); |
| | | Map<String, Map<String, PI_Field_Policy_Detail__c>> mmsp = new Map<String, Map<String,PI_Field_Policy_Detail__c>>(); |
| | | for (String key : staticResource.keySet()) { |
| | | mmsp.put(key, new Map<String,PI_Field_Policy_Detail__c>()); |
| | | for (PI_Field_Policy_Detail__c detail : staticResource.get(key).PIDetails) { |
| | | mmsp.get(key).put(detail.SF_Field_API_Name__c, detail); |
| | | } |
| | | } |
| | | |
| | | //1.查询出对应修理的数据 |
| | | Repair__c repair = [select Id,Hospital__c,address_Contacts__c,AWS_Data_Id__c from Repair__c where id=:rid]; |
| | | Account ac = [SELECT id,OCM_man_province_txt__c,FieldCity_Master_Name__c from Account where id =:repair.Hospital__c]; |
| | | String province = ''; |
| | | String city = ''; |
| | | String provinceAndCity = ''; |
| | | if('山东' == ac.OCM_man_province_txt__c){ |
| | | if('烟台市' == ac.FieldCity_Master_Name__c || '威海市' == ac.FieldCity_Master_Name__c || '日照市' == ac.FieldCity_Master_Name__c |
| | | || '青岛市' == ac.FieldCity_Master_Name__c || '潍坊市' == ac.FieldCity_Master_Name__c){ |
| | | provinceAndCity = matchupMap.get('山东,青岛市'); |
| | | }else{ |
| | | provinceAndCity = matchupMap.get('山东,济南市'); |
| | | } |
| | | }else{ |
| | | provinceAndCity = matchupMap.get(ac.OCM_man_province_txt__c); |
| | | } |
| | | if(provinceAndCity != null){ |
| | | province = provinceAndCity.split(',')[0]; |
| | | city = provinceAndCity.split(',')[1]; |
| | | } |
| | | String addressSQl = 'SELECT ID,AWS_Data_Id__c,Customer__c,Customer_Name__c,Contacts__c,Contacts__r.AWS_Data_Id__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c' |
| | | + ' from Address__c ' |
| | | + ' where Address_Classification__c = \'办事处\' and Province_Name__c =: province and City_Name__c =: city ' |
| | | + ' order by Using_Datetime__c desc NULLS LAST '; |
| | | system.debug('addressSQl='+addressSQl); |
| | | List<Address__c> addressList = Database.query(addressSQl); |
| | | |
| | | //开始组装数据 |
| | | List<AWSServiceTool2V2.EncryptPushRequestBody> EncryptPushList = new List<AWSServiceTool2V2.EncryptPushRequestBody>(); |
| | | AWSServiceTool2V2.EncryptPushRequestBody EncryptPush = new AWSServiceTool2V2.EncryptPushRequestBody(); |
| | | EncryptPush.dataId = repair.AWS_Data_Id__c != null ?repair.AWS_Data_Id__c:''; |
| | | EncryptPush.sfRecordId = repair.Id; |
| | | EncryptPush.fieldsMapping = new Map<String, List<AWSServiceTool2V2.EncryptPushRes>>(); |
| | | //联系人名称,如果对应收货地址的联系人没有,就不更新该字段 |
| | | if(!String.isBlank(addressList[0].Customer__c)){ |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res = new AWSServiceTool2V2.EncryptPushRes(); |
| | | res.isQueryDb = true; |
| | | res.table = staticResource.get('Contact').awsTableName; |
| | | res.field = mmsp.get('Contact').get('LastName').AWS_Field_API__c; |
| | | res.value = ''; |
| | | res.dataId = addressList[0].Contacts__r.AWS_Data_Id__c; |
| | | resList.add(res); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Repair__c').get('address_Contacts__c').AWS_Field_API__c, resList); |
| | | } |
| | | //邮编 |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList2 = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res2 = new AWSServiceTool2V2.EncryptPushRes(); |
| | | res2.isQueryDb = true; |
| | | res2.table = staticResource.get('Address__c').awsTableName; |
| | | res2.field = mmsp.get('Address__c').get('ZipCode__c').AWS_Field_API__c; |
| | | res2.value = ''; |
| | | res2.dataId = addressList[0].AWS_Data_Id__c; |
| | | resList2.add(res2); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Repair__c').get('address_ZipCode__c').AWS_Field_API__c, resList2); |
| | | |
| | | //address_Telephone__c |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList3 = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res3 = new AWSServiceTool2V2.EncryptPushRes(); |
| | | res3.isQueryDb = true; |
| | | res3.table = staticResource.get('Address__c').awsTableName; |
| | | res3.field = mmsp.get('Address__c').get('Telephone__c').AWS_Field_API__c; |
| | | res3.value = ''; |
| | | res3.dataId = addressList[0].AWS_Data_Id__c; |
| | | resList3.add(res3); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Repair__c').get('address_Telephone__c').AWS_Field_API__c, resList3); |
| | | |
| | | String cityName = ''; |
| | | String ProvinceCity = ''; |
| | | if(String.isNotBlank(addressList[0].City_Name__c)) |
| | | cityName = addressList[0].City_Name__c.trim(); |
| | | if(String.isNotBlank(addressList[0].Province_Name__c)) |
| | | ProvinceCity = addressList[0].Province_Name__c.trim()+cityName; |
| | | |
| | | //Detailed_Address__c |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList4 = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res4 = new AWSServiceTool2V2.EncryptPushRes(); |
| | | res4.isQueryDb = false; |
| | | res4.table = ''; |
| | | res4.field = ''; |
| | | res4.value = ProvinceCity; |
| | | resList4.add(res4); |
| | | AWSServiceTool2V2.EncryptPushRes res5 = new AWSServiceTool2V2.EncryptPushRes(); |
| | | res5.isQueryDb = true; |
| | | res5.table = staticResource.get('Address__c').awsTableName; |
| | | res5.field = mmsp.get('Address__c').get('Detailed_Address__c').AWS_Field_API__c; |
| | | res5.value = ''; |
| | | res5.dataId = addressList[0].AWS_Data_Id__c; |
| | | resList4.add(res5); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Repair__c').get('Detailed_Address__c').AWS_Field_API__c, resList4); |
| | | EncryptPushList.add(EncryptPush); |
| | | System.debug('EncryptPushListdataId = ' + JSON.serialize(EncryptPushList[0].dataId)); |
| | | System.debug('EncryptPushListsfRecordId = ' + JSON.serialize(EncryptPushList[0].sfRecordId)); |
| | | System.debug('EncryptPushListfieldsMapping = ' + JSON.serialize(EncryptPushList[0].fieldsMapping)); |
| | | System.debug('EncryptPushList = ' + JSON.serialize(EncryptPushList)); |
| | | |
| | | List<Repair__c> aclist = new List<Repair__c>(); |
| | | aclist.add(repair); |
| | | return EncryptPushCoreV2(Json.serialize(EncryptPushList),Json.serialize(aclist), 'Repair__c'); |
| | | } |
| | | |
| | | //创建/更新联系人之后,创建/更新.客户人员,并且发给AWS |
| | | @future(callout=true) |
| | | public static void EncryptPushFutureV2(string json_list,string acList,string sobject_name){ |
| | | EncryptPushCoreV2(json_list,acList,sobject_name); |
| | | } |
| | | |
| | | // List<Rental_Apply__c> temps = [select id,AWS_Data_Id__c,name, direct_shippment_address__c, Direct_Shippment_Address_Encrypt__c, Phone_number__c, Phone_Number_Encrypt__c,CreatedDate from Rental_Apply__c where AWS_Data_Id__c != null order by CreatedDate desc limit 2]; |
| | | public static boolean EncryptPushCoreV2(string json_list,string acList,string sobject_name){ |
| | | system.debug('enter EncryptPushCoreV2'); |
| | | if(string.isBlank(json_list) || string.isBlank(sobject_name) || string.isBlank(acList)){ |
| | | system.debug('json_list or sobject_name is null'); |
| | | return false; |
| | | } |
| | | |
| | | //调用滨璜接口更新 |
| | | PIHelper.PIIntegration staticResourceV2 = getPIIntegration(sobject_name+'V2'); |
| | | system.debug('json_list='+json_list); |
| | | system.debug('acList='+acList); |
| | | system.debug('staticResourceV2.token='+staticResourceV2.token); |
| | | system.debug('staticResourceV2='+staticResourceV2); |
| | | system.debug('staticResourceV2.newEncryptUrl='+staticResourceV2.newEncryptUrl); |
| | | if(String.isBlank(staticResourceV2.token)){ |
| | | System.debug('获取aws token 失败'); |
| | | return false; |
| | | } |
| | | |
| | | Map<String,Object> temp = null; |
| | | List<object> objList = new List<object>(); |
| | | temp = PostAws(json_list,staticResourceV2.newEncryptUrl,staticResourceV2.token); |
| | | System.debug('temp = ' + temp); |
| | | if(temp == null){ |
| | | System.debug('temp == null'); |
| | | return false; |
| | | } |
| | | List<object> newobjectList = (List<object>)Json.deserializeUntyped(acList); |
| | | Map<Id,Sobject> newMap = new Map<Id,Sobject>(); |
| | | for(object obj : newobjectList){ |
| | | Map<string,object> mobj = (Map<string,object>)obj; |
| | | if(mobj.containsKey('Id')){ |
| | | Sobject sobj_temp = (Sobject)Json.deserialize(Json.serialize(obj), Type.forName(sobject_name)); |
| | | newMap.put(sobj_temp.Id,sobj_temp); |
| | | } |
| | | } |
| | | System.debug('newMap = ' + newMap); |
| | | //进行更新,根据dataid |
| | | List<Sobject> updateList = new List<Sobject>(); |
| | | for(String key : newMap.keySet()){ |
| | | if(temp.containsKey(key)){ |
| | | Sobject ra = newMap.get(key); |
| | | ra.put('AWS_Data_Id__c',String.valueOf(temp.get(key))); |
| | | updateList.add(ra); |
| | | } |
| | | } |
| | | System.debug('updateList = ' + updateList); |
| | | if(updateList.size() > 0){ |
| | | update updateList; |
| | | } |
| | | return true; |
| | | |
| | | |
| | | |
| | | |
| | | // Map<Id,Sobject> newMap = new Map<Id,Sobject>(); |
| | | |
| | | // for(object obj : newobjectList){ |
| | | // Map<string,object> mobj = (Map<string,object>)obj; |
| | | // if(mobj.containsKey('Id')){ |
| | | // Sobject sobj_temp = (Sobject)Json.deserialize(Json.serialize(obj), Type.forName(sobject_name)); |
| | | // newMap.put(sobj_temp.Id,sobj_temp); |
| | | // } |
| | | // } |
| | | // List<Map<string,object>> insert_list = new List<Map<string,object>>(); |
| | | // List<Map<string,object>> update_list = new List<Map<string,object>>(); |
| | | // List<sobject> newList = newMap.values(); |
| | | // for(Sobject ra : newList){ |
| | | // Map<string,object> mso = new Map<string,object>(); |
| | | |
| | | |
| | | // for(PI_Field_Policy_Detail__c detail : staticResource.PIDetails){ |
| | | // if(ra.isSet(detail.SF_Field_API_Name__c)){ |
| | | // mso.put(detail.AWS_Field_API__c,ra.get(detail.SF_Field_API_Name__c)); |
| | | // //mso.put(detail.AWS_Encrypted_Field_API__c,ra.get(detail.SF_Field_Encrypted_API__c)); |
| | | // } |
| | | // } |
| | | // mso.put('sfRecordId',ra.Id); |
| | | // string aws_id = string.valueOf(ra.get('AWS_Data_Id__c')); |
| | | // system.debug('aws_id='+aws_id); |
| | | // if(string.isBlank(aws_id)){ |
| | | // insert_list.add(mso); |
| | | // }else{ |
| | | // system.debug('aws_id.lenth='+aws_id.length()); |
| | | // mso.put('dataId',aws_id); |
| | | // update_list.add(mso); |
| | | // } |
| | | |
| | | // } |
| | | // List<object> objList = new List<object>(); |
| | | // List<Sobject> updateList = new List<Sobject>(); |
| | | // List<object> temp = null; |
| | | // system.debug('insert_list.size()='+insert_list.size()); |
| | | // system.debug('update_list.size()='+update_list.size()); |
| | | // //if(true)return; |
| | | // if(insert_list.size() > 0){ |
| | | // system.debug('url='+staticResource.newEncryptUrl); |
| | | // temp = PostAws(Json.serialize(insert_list),staticResource.newEncryptUrl,staticResource.token); |
| | | // if(temp != null){ |
| | | // objList.addAll(temp); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // if(update_list.size() > 0){ |
| | | // system.debug('url='+staticResource.updateEncryptUrl); |
| | | // temp = PostAws(Json.serialize(update_list),staticResource.updateEncryptUrl,staticResource.token); |
| | | // if(temp != null){ |
| | | // objList.addAll(temp); |
| | | // } |
| | | // } |
| | | |
| | | // system.debug('objList.size()='+objList.size()); |
| | | // if(objList.size()==0){ |
| | | // return false; |
| | | // } |
| | | |
| | | |
| | | // for(object obj : objList){ |
| | | // Map<string,object> obj_map = (Map<string,object>)obj; |
| | | // string sfRecordId = null; |
| | | // string dataId = null; |
| | | // if(obj_map.containsKey('sfRecordId')){ |
| | | // sfRecordId = string.valueOf(obj_map.get('sfRecordId')); |
| | | // }else{ |
| | | // system.debug('obj_map.containsKey(\'sfRecordId\')='+obj_map.containsKey('sfRecordId')); |
| | | // continue; |
| | | // } |
| | | |
| | | // if(obj_map.containsKey('dataId')){ |
| | | // dataId = string.valueOf(obj_map.get('dataId')); |
| | | // }else{ |
| | | // system.debug('obj_map.containsKey(\'dataId\')='+obj_map.containsKey('dataId')); |
| | | // continue; |
| | | // } |
| | | |
| | | |
| | | // if(newMap.containsKey(sfRecordId)){ |
| | | // Sobject ra = newMap.get(sfRecordId); |
| | | // for(PI_Field_Policy_Detail__c detail : staticResource.PIDetails){ |
| | | // if(obj_map.containsKey(detail.AWS_Field_API__c)){ |
| | | // ra.put(detail.SF_Field_API_Name__c,obj_map.get(detail.AWS_Field_API__c)); |
| | | // }else{ |
| | | // system.debug('detail.AWS_Field_API__c='+detail.AWS_Field_API__c+' not in obj_map'); |
| | | // } |
| | | |
| | | // if(obj_map.containsKey(detail.AWS_Encrypted_Field_API__c)){ |
| | | // ra.put(detail.SF_Field_Encrypted_API__c,obj_map.get(detail.AWS_Encrypted_Field_API__c)); |
| | | // }else{ |
| | | // system.debug('detail.AWS_Encrypted_Field_API__c='+detail.AWS_Encrypted_Field_API__c+' not in obj_map'); |
| | | // } |
| | | // } |
| | | // ra.put('AWS_Data_Id__c',dataId); |
| | | |
| | | // updateList.add(ra); |
| | | // }else{ |
| | | // system.debug('newMap.containsKey('+sfRecordId+')='+newMap.containsKey(sfRecordId)); |
| | | // continue; |
| | | // } |
| | | // } |
| | | |
| | | // system.debug('updateList.size='+updateList.size()); |
| | | // if(updateList.size()>0){ |
| | | // update updateList; |
| | | // } |
| | | |
| | | // return true; |
| | | } |
| | | |
| | | static Map<String,Object> PostAws(string payload,string url,string token){ |
| | | system.debug('payload='+payload); |
| | | system.debug('url='+url); |
| | | system.debug('token='+token); |
| | | NFMUtil.response response = NFMUtil.sendToPiAWS(payload, url,token); |
| | | system.debug('response = ' + response); |
| | | Map<string,object> res_obj = (Map<string,object>)Json.deserializeUntyped(response.responseBody); |
| | | if(res_obj == null || !res_obj.containsKey('object') ){ |
| | | System.debug('res_obj == null || !res_obj.containsKey(\'object\')'); |
| | | return null; |
| | | } |
| | | |
| | | Map<String,Object> objMap = (Map<String,Object>)res_obj.get('object'); |
| | | System.debug('objMap =' + objMap); |
| | | if(objMap == null){ |
| | | System.debug('objMap == null'); |
| | | return null; |
| | | } |
| | | return objMap; |
| | | } |
| | | |
| | | |
| | | global class EncryptPushRequestBody { |
| | | // aws dataid 目标对象 |
| | | public String dataId {set; get;} |
| | | // sfID 记录Id 目标对象 |
| | | public String sfRecordId {set; get;} |
| | | // 字段映射 如:name:{} |
| | | public Map<String, List<EncryptPushRes>> fieldsMapping {set; get;} |
| | | |
| | | public EncryptPushRequestBody(String dataId, String sfRecordId, Map<String, List<EncryptPushRes>> fieldsMapping) { |
| | | this.dataId = dataId; |
| | | this.sfRecordId = sfRecordId; |
| | | this.fieldsMapping = fieldsMapping; |
| | | } |
| | | public EncryptPushRequestBody() { |
| | | } |
| | | } |
| | | |
| | | global class EncryptPushRes{ |
| | | public Boolean isQueryDb; |
| | | public String table; |
| | | public String dataId; |
| | | public String field; |
| | | public String value; |
| | | |
| | | public EncryptPushRes(Boolean isQueryDb, String table, String dataId, String field, String value) { |
| | | this.isQueryDb = isQueryDb; |
| | | this.table = table; |
| | | this.dataId = dataId; |
| | | this.field = field; |
| | | this.value = value; |
| | | } |
| | | public EncryptPushRes() {} |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public with sharing class AWSServiceTool2V2Test { |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Repair__c','Agency_Contact__c','Contact','Address__c','Repair__cV2'}); |
| | | } |
| | | |
| | | |
| | | @isTest |
| | | static void Test1(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | Repair__c rs = TestDataUtility.CreateRepairs(1)[0]; |
| | | |
| | | Contact contact2 = new Contact(); |
| | | contact2.AccountId = rs.Account__c; |
| | | contact2.FirstName = '小明'; |
| | | contact2.LastName = 'test1经销商'; |
| | | insert contact2; |
| | | |
| | | Address_Level__c alc1 = new Address_Level__c( |
| | | Name = '山东' |
| | | ); |
| | | Address_Level2__c alc11 = new Address_Level2__c( |
| | | Name = '青岛市',Address_Level__c = alc1.Id,Level1_Name__c='山东' |
| | | ); |
| | | Address__c add = new Address__c(); |
| | | add.Address_Classification__c = '办事处'; |
| | | add.Customer__c = rs.Account__c; |
| | | add.Contacts__c = contact2.id; |
| | | add.Telephone__c = '123123'; |
| | | add.Province__c = alc1.Id; |
| | | add.City__c = alc11.Id; |
| | | add.Detailed_Address__c = '北京市顺义区西海洪村'; |
| | | insert add; |
| | | |
| | | Test.startTest(); |
| | | AWSServiceTool2V2.EncryptPushDataRepair(rs.Id); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | class HttpMock implements HttpCalloutMock{ |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | if(request.getEndpoint().contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | |
| | | body='{"message":"RT_SUCCESS","object":{"a0J9D000003pVS3UAM":"1058028677385682945"},"status":"0","success":true,"timestamp":1672295303119}'; |
| | | } else if(request.getEndpoint().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{"message":"RT_SUCCESS","object":{"a0J9D000003pVS3UAM":"1058028677385682945"},"status":"0","success":true,"timestamp":1672295303119}'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public without sharing class AccChangeApprovalResponseController { |
| | | // 客户变更申请 |
| | | public Account_Delay_Apply__c ra { get; set; } |
| | | public Account_Delay_Apply__c cc { get; set; } |
| | | // 客户ID |
| | | public Id accid { get; private set; } |
| | | // To:当前审批人(response2system),To:申请者(response2user) |
| | | public String type { get; set; } |
| | | |
| | | public Boolean hasError { get; private set; } |
| | | public String baseUrl { get; private set; } |
| | | |
| | | public User systemUser { get; set; } |
| | | |
| | | public AccChangeApprovalResponseController() { |
| | | //Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8'); |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | accid = ApexPages.currentPage().getParameters().get('accid'); |
| | | type = ApexPages.currentPage().getParameters().get('type'); |
| | | } |
| | | |
| | | public AccChangeApprovalResponseController(ApexPages.StandardController stdController) { |
| | | //Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8'); |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | accid = stdController.getId(); |
| | | type = ApexPages.currentPage().getParameters().get('type'); |
| | | } |
| | | |
| | | // 画面初始化 |
| | | public void init() { |
| | | hasError = true; |
| | | List<Account_Delay_Apply__c> raList = [select Id, Name, Is_Active__c, Response__c, |
| | | ResponseNew__c, CreatedById, CreatedBy.Name, |
| | | CreatedBy.Email, Response_Cc_User1__c, |
| | | Response_Cc_User2__c, Response_Cc_User3__c, |
| | | Response_Cc_User4__c, Response_Cc_User5__c, |
| | | Response_Cc_User6__c |
| | | from Account_Delay_Apply__c |
| | | where id = : accid ]; |
| | | |
| | | if (raList.size() > 0) { |
| | | ra = raList[0]; |
| | | cc = raList[0]; |
| | | } |
| | | cc.Response_Cc_User1__c = null; |
| | | cc.Response_Cc_User2__c = null; |
| | | cc.Response_Cc_User3__c = null; |
| | | cc.Response_Cc_User4__c = null; |
| | | cc.Response_Cc_User5__c = null; |
| | | cc.Response_Cc_User6__c = null; |
| | | |
| | | // List<User> toSysUser = [select Id, Name, Email from User where Id = : System.Label.LeaderID_Zhu]; |
| | | // if (toSysUser.size() > 0) { |
| | | // systemUser = toSysUser[0]; |
| | | // } |
| | | |
| | | // 邮件默认cc |
| | | if (type == 'response2system') { |
| | | |
| | | } else if (type == 'response2user') { |
| | | |
| | | } |
| | | } |
| | | |
| | | // 保存按钮 |
| | | public PageReference saveBtn() { |
| | | hasError = true; |
| | | |
| | | String response = cc.ResponseNew__c; |
| | | if (String.isBlank(response) == true || response.trim().length() == 0) { |
| | | cc.ResponseNew__c.addError('请输入内容。'); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | // 送信者 |
| | | String username = UserInfo.getName(); |
| | | // 发送时间 |
| | | Datetime dt = Datetime.now(); |
| | | // 相关用户检索 |
| | | List<Id> ccList = new List<Id>(); |
| | | if (String.isBlank(cc.Response_Cc_User1__c) == false) { |
| | | ccList.add(cc.Response_Cc_User1__c); |
| | | } |
| | | if (String.isBlank(cc.Response_Cc_User2__c) == false) { |
| | | ccList.add(cc.Response_Cc_User2__c); |
| | | } |
| | | if (String.isBlank(cc.Response_Cc_User3__c) == false) { |
| | | ccList.add(cc.Response_Cc_User3__c); |
| | | } |
| | | if (String.isBlank(cc.Response_Cc_User4__c) == false) { |
| | | ccList.add(cc.Response_Cc_User4__c); |
| | | } |
| | | if (String.isBlank(cc.Response_Cc_User5__c) == false) { |
| | | ccList.add(cc.Response_Cc_User5__c); |
| | | } |
| | | Map<Id, User> userMap = new Map<Id, User>([ |
| | | select Id, Name, Email from User where Id in :ccList |
| | | ]); |
| | | |
| | | List<Id> toList = new List<Id>(); |
| | | if (String.isBlank(cc.Response_Cc_User6__c) == false) { |
| | | toList.add(cc.Response_Cc_User6__c); |
| | | } |
| | | Map<Id, User> touserMap = new Map<Id, User>([ |
| | | select Id, Name, Email from User where Id in :toList |
| | | ]); |
| | | |
| | | // 收信者 |
| | | String toName = ''; |
| | | List<String> toMailList = new List<String>(); |
| | | if (type == 'response2system') { |
| | | // toName = systemUser.Name; |
| | | // toMailList.add(systemUser.Email); |
| | | if (touserMap.size() > 0) { |
| | | for (Id id : touserMap.keySet()) { |
| | | toName += touserMap.get(id).Name + ', '; |
| | | toMailList.add(touserMap.get(id).Email); |
| | | } |
| | | } |
| | | System.debug('lt123---toname---'+toName); |
| | | System.debug('lt123---String.isBlank(toName)---'+String.isBlank(toName)); |
| | | if (toName != '') { |
| | | toName = toName.left(toName.length() - 2); |
| | | }else if(String.isBlank(toName) == true){ |
| | | cc.Response_Cc_User6__c.addError('to审批人必填。'); |
| | | return null; |
| | | } |
| | | } else if (type == 'response2user') { |
| | | toName = ra.CreatedBy.Name; |
| | | toMailList.add(ra.CreatedBy.Email); |
| | | } |
| | | // 抄送者 |
| | | String ccName = ''; |
| | | List<String> ccMailList = new List<String>(); |
| | | |
| | | |
| | | //WLIG-BS2CJW ---20200807---update By rentongxiao ---Start |
| | | //获取 郭 和 油 的信息 |
| | | // String ydIdsStr = System.Label.LeaderId_YD; |
| | | // List<String> ydIds = ydIdsStr.split(','); |
| | | |
| | | // List<User> yds = [select Id, Name, Email from User where Id in : ydIds]; |
| | | |
| | | // if(type == 'response2user'){ |
| | | // // ccName += systemUser.Name + ', '; |
| | | // // ccMailList.add(systemUser.Email); |
| | | // if (yds.size() > 0) { |
| | | // for(User u : yds){ |
| | | // ccName += u.Name +', '; |
| | | // ccMailList.add(u.Email); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | //WLIG-BS2CJW ---20200807---update By rentongxiao---End |
| | | |
| | | if (userMap.size() > 0) { |
| | | for (Id id : userMap.keySet()) { |
| | | ccName += userMap.get(id).Name + ', '; |
| | | ccMailList.add(userMap.get(id).Email); |
| | | } |
| | | } |
| | | |
| | | if (ccName != '') { |
| | | ccName = ccName.left(ccName.length() - 2); |
| | | } |
| | | |
| | | // 原应答沟通信息 |
| | | String oldResponse = ra.Response__c; |
| | | // 现应答沟通信息 |
| | | String temp = ''; |
| | | temp += '****** ' + username + ' ' + dt.format() + ' ******\n'; |
| | | temp += '*** To:' + toName + '\n'; |
| | | temp += '*** Cc:' + ccName + '\n'; |
| | | temp += cc.ResponseNew__c; |
| | | if (oldResponse != null && oldResponse.trim().length() > 0) { |
| | | temp += '\n\n' + oldResponse; |
| | | } else { |
| | | //于2016-07-01加入<a></a> |
| | | temp += '\n\n客户变更链接: ' + baseUrl + '/' + ra.Id +' '; |
| | | } |
| | | |
| | | try { |
| | | //Create insatnce of actual email |
| | | Messaging.SingleEmailMessage messageNEW= new Messaging.SingleEmailMessage(); |
| | | |
| | | messageNEW.Subject = '客户变更 ' + ra.Name + ' -审批联络'; |
| | | messageNEW.PlainTextBody = temp; |
| | | //set desired email addresses |
| | | messageNEW.setCharset('UTF-8'); |
| | | messageNEW.toAddresses = toMailList; |
| | | messageNEW.ccAddresses = ccMailList; |
| | | //send the mail |
| | | Messaging.SendEmailResult[] results = messaging.sendEmail(new Messaging.SingleEmailMessage[] {messageNEW}); |
| | | if(!results[0].success){ |
| | | cc.ResponseNew__c.addError('邮件发送失败。'); |
| | | return null; |
| | | }else{ |
| | | // 更新应答沟通 |
| | | Account_Delay_Apply__c updacc = new Account_Delay_Apply__c(); |
| | | updacc.Id = ra.Id; |
| | | updacc.Response__c = temp; |
| | | update updacc; |
| | | |
| | | hasError=false; |
| | | return null; |
| | | } |
| | | } catch (Exception ex) { |
| | | ApexPages.addMessages(ex); |
| | | return null; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public with sharing class AccChangeApprovalResponseControllerTest { |
| | | |
| | | |
| | | static User setNewUser(String firstName, String lastName, String aName, String email) { |
| | | User user = new User(Test_staff__c = true); |
| | | user.LastName = ' ' + lastName; |
| | | user.FirstName = firstName; |
| | | user.Alias = aName; |
| | | user.Email = email; |
| | | user.Username = 'Olympus' + email; |
| | | user.CommunityNickname = aName; |
| | | user.IsActive = true; |
| | | user.EmailEncodingKey = 'ISO-2022-JP'; |
| | | user.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | user.LocaleSidKey = 'ja_JP'; |
| | | user.LanguageLocaleKey = 'ja'; |
| | | user.ProfileId = System.Label.ProfileId_SystemAdmin; |
| | | user.Job_Category__c = '销售推广'; |
| | | user.Province__c = '上海市'; |
| | | user.Use_Start_Date__c = Date.today().addMonths(-6); |
| | | insert user; |
| | | |
| | | return user; |
| | | } |
| | | |
| | | static testMethod void test_method_one() { |
| | | User user1 = setNewUser('ztest01', 'User001', 'Zhang001', 'test001@excemaple.com'); |
| | | User user2 = setNewUser('ztest02', 'User002', 'Zhang002', 'test002@excemaple.com'); |
| | | User user3 = setNewUser('ztest03', 'User003', 'Zhang003', 'test003@excemaple.com'); |
| | | User user4 = setNewUser('ztest04', 'User004', 'Zhang004', 'test004@excemaple.com'); |
| | | User user5 = setNewUser('ztest05', 'User005', 'Zhang005', 'test005@excemaple.com'); |
| | | User toUser = setNewUser('shenqing', 'shenpi', 'spsqTest', 'shenpi@excemaple.com'); |
| | | |
| | | // 病院を作る |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'test hospital'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.OwnerId = toUser.Id; |
| | | |
| | | //WLIG-BS2CJW --执行测试类报异常MIXED_DML_OPERATION ---20200807---update By rentongxiao ---Start |
| | | // insert hospital; |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert hospital; |
| | | } |
| | | } |
| | | //WLIG-BS2CJW ---20200807---update By rentongxiao ---End |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = hospital.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.Is_Active__c = '申请中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user5.Id; |
| | | ada.InstitutionalType__c = '非医疗机构'; |
| | | ada.CreatedById = toUser.Id; |
| | | |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert ada; |
| | | } |
| | | } |
| | | |
| | | // 画面迁移--沟通应答画面 |
| | | PageReference page = new PageReference('/apex/AccChangeApprovalResponseControllerPopUp?accid=' + ada.Id + '&type=response2system'); |
| | | System.Test.setCurrentPage(page); |
| | | AccChangeApprovalResponseController controller = new AccChangeApprovalResponseController(); |
| | | controller.init(); |
| | | |
| | | controller.cc.ResponseNew__c = 'test goutong'; |
| | | // 保存 |
| | | controller.saveBtn(); |
| | | } |
| | | |
| | | static testMethod void test_method_two() { |
| | | User user1 = setNewUser('ztest01', 'User001', 'Zhang001', 'test001@excemaple.com'); |
| | | User user2 = setNewUser('ztest02', 'User002', 'Zhang002', 'test002@excemaple.com'); |
| | | User user3 = setNewUser('ztest03', 'User003', 'Zhang003', 'test003@excemaple.com'); |
| | | User user4 = setNewUser('ztest04', 'User004', 'Zhang004', 'test004@excemaple.com'); |
| | | User user5 = setNewUser('ztest05', 'User005', 'Zhang005', 'test005@excemaple.com'); |
| | | User toUser = setNewUser('shenqing', 'shenpi', 'spsqTest', 'shenpi@excemaple.com'); |
| | | |
| | | // 病院を作る |
| | | // Account hospital = new Account(); |
| | | // hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | // hospital.Name = 'test hospital'; |
| | | // hospital.Is_Active__c = '申请中'; |
| | | // hospital.OwnerId = toUser.Id; |
| | | |
| | | // //WLIG-BS2CJW --执行测试类报异常MIXED_DML_OPERATION ---20200807---update By rentongxiao ---Start |
| | | // // insert hospital; |
| | | // if (Test.isRunningTest()) { |
| | | // System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | // insert hospital; |
| | | // } |
| | | // } |
| | | //WLIG-BS2CJW ---20200807---update By rentongxiao ---End |
| | | |
| | | // 病院を作る |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'test hospital'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.OwnerId = toUser.Id; |
| | | |
| | | //WLIG-BS2CJW --执行测试类报异常MIXED_DML_OPERATION ---20200807---update By rentongxiao ---Start |
| | | // insert hospital; |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert hospital; |
| | | } |
| | | } |
| | | //WLIG-BS2CJW ---20200807---update By rentongxiao ---End |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = hospital.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.Is_Active__c = '申请中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user5.Id; |
| | | ada.InstitutionalType__c = '非医疗机构'; |
| | | ada.CreatedById = toUser.Id; |
| | | |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert ada; |
| | | } |
| | | } |
| | | |
| | | // 画面迁移--沟通应答画面 |
| | | PageReference page = new PageReference('/apex/AccChangeApprovalResponseControllerPopUp?accid=' + ada.Id + '&type=response2user'); |
| | | System.Test.setCurrentPage(page); |
| | | AccChangeApprovalResponseController controller2 = new AccChangeApprovalResponseController(new ApexPages.StandardController(ada)); |
| | | controller2.init(); |
| | | controller2.saveBtn(); |
| | | |
| | | // 发送按钮 |
| | | controller2.cc.Response__c = 'test goutong'; |
| | | controller2.cc.ResponseNew__c = 'test .......'; |
| | | controller2.cc.Response_Cc_User1__c = user1.Id; |
| | | controller2.cc.Response_Cc_User2__c = user2.Id; |
| | | controller2.cc.Response_Cc_User3__c = user3.Id; |
| | | controller2.cc.Response_Cc_User4__c = user4.Id; |
| | | controller2.cc.Response_Cc_User5__c = user5.Id; |
| | | controller2.saveBtn(); |
| | | } |
| | | |
| | | static testMethod void test_method_three() { |
| | | User toUser = setNewUser('shenqing', 'shenpi', 'spsqTest', 'shenpi@excemaple.com'); |
| | | User user5 = setNewUser('ztest05', 'User005', 'Zhang005', 'test005@excemaple.com'); |
| | | |
| | | // 病院を作る |
| | | // Account hospital = new Account(); |
| | | // hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | // hospital.Name = 'test hospital'; |
| | | // hospital.Is_Active__c = '申请中'; |
| | | // hospital.OwnerId = toUser.Id; |
| | | |
| | | // //WLIG-BS2CJW --执行测试类报异常MIXED_DML_OPERATION ---20200807---update By rentongxiao ---Start |
| | | // // insert hospital; |
| | | // if (Test.isRunningTest()) { |
| | | // System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | // insert hospital; |
| | | // } |
| | | // } |
| | | //WLIG-BS2CJW ---20200807---update By rentongxiao ---Start |
| | | |
| | | // 病院を作る |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'test hospital'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.OwnerId = toUser.Id; |
| | | |
| | | //WLIG-BS2CJW --执行测试类报异常MIXED_DML_OPERATION ---20200807---update By rentongxiao ---Start |
| | | // insert hospital; |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert hospital; |
| | | } |
| | | } |
| | | //WLIG-BS2CJW ---20200807---update By rentongxiao ---End |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = hospital.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.Is_Active__c = '申请中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user5.Id; |
| | | ada.InstitutionalType__c = '非医疗机构'; |
| | | ada.CreatedById = toUser.Id; |
| | | |
| | | if (Test.isRunningTest()) { |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert ada; |
| | | } |
| | | } |
| | | |
| | | // 画面迁移--沟通应答画面 |
| | | PageReference page = new PageReference('/apex/AccChangeApprovalResponseControllerPopUp?accid=' + ada.Id + '&type=response2user'); |
| | | System.Test.setCurrentPage(page); |
| | | AccChangeApprovalResponseController controller3 = new AccChangeApprovalResponseController(); |
| | | controller3.init(); |
| | | |
| | | controller3.cc.Response__c = 'test goutong'; |
| | | controller3.ra.CreatedBy.Email = '111111111111'; |
| | | // 发送按钮 |
| | | controller3.saveBtn(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | //Integer Soakup_NotExecute_Day = Integer.valueOf(System.Label.Soakup_NotExecute_Day); |
| | | Integer SSBacth_Execute_Day = Integer.valueOf(System.Label.SSBacth_Execute_Day); |
| | | if (workdays1 == SSBacth_Execute_Day || workdays != SSBacth_Execute_Day) { |
| | | Id execBTId = Database.executeBatch(new AccountDailyUpdateBatch('1.华北'),4); |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('2.东北'),4); |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('3.西北'),4); |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('4.西南'),4); |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('5.华东'),3); |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('6.华南'),4); |
| | | // Id execBTId = Database.executeBatch(new AccountDailyUpdateBatch('1.华北'),4); // 2022-06-01 zyh udate |
| | | // execBTId = Database.executeBatch(new AccountDailyUpdateBatch('2.东北'),4); // 2022-06-01 zyh udate |
| | | // execBTId = Database.executeBatch(new AccountDailyUpdateBatch('3.西北'),4); // 2022-06-01 zyh udate |
| | | // execBTId = Database.executeBatch(new AccountDailyUpdateBatch('4.西南'),4); // 2022-06-01 zyh udate |
| | | // execBTId = Database.executeBatch(new AccountDailyUpdateBatch('5.华东'),3); // 2022-06-01 zyh udate |
| | | // execBTId = Database.executeBatch(new AccountDailyUpdateBatch('6.华南'),4); // 2022-06-01 zyh udate |
| | | Id execBTId = Database.executeBatch(new AccountDailyUpdateBatch('1.华北'),2); // 2022-06-01 zyh udate |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('2.东北'),2); // 2022-06-01 zyh udate |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('3.西北'),2); // 2022-06-01 zyh udate |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('4.西南'),2); // 2022-06-01 zyh udate |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('5.华东'),2); // 2022-06-01 zyh udate |
| | | execBTId = Database.executeBatch(new AccountDailyUpdateBatch('6.华南'),2); // 2022-06-01 zyh udate |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | public without sharing class AccountDelayApplyHandler extends Oly_TriggerHandler { |
| | | private Map<Id, Account_Delay_Apply__c> newMap; |
| | | private Map<Id, Account_Delay_Apply__c> oldMap; |
| | | private List<Account_Delay_Apply__c> newList; |
| | | private List<Account_Delay_Apply__c> oldList; |
| | | |
| | | public AccountDelayApplyHandler() { |
| | | this.newMap = (Map<Id, Account_Delay_Apply__c>) Trigger.newMap; |
| | | this.oldMap = (Map<Id, Account_Delay_Apply__c>) Trigger.oldMap; |
| | | this.newList = (List<Account_Delay_Apply__c>) Trigger.new; |
| | | this.oldList = (List<Account_Delay_Apply__c>) Trigger.old; |
| | | } |
| | | |
| | | protected override void beforeInsert(){ |
| | | // OpenWindow(); |
| | | OpenWindow1(); |
| | | } |
| | | protected override void afterInsert(){ |
| | | MultiOption(); |
| | | } |
| | | protected override void beforeUpdate(){ |
| | | MultiOption(); |
| | | setColumn(); |
| | | // OpenWindow(); |
| | | CustomizePageJudge(); |
| | | } |
| | | protected override void afterUpdate(){ |
| | | MultiOption(); |
| | | setAccColumn(); |
| | | } |
| | | |
| | | //多选项数据统计 |
| | | private void MultiOption(){ |
| | | //创建参数 key:Sobject对象 value:发生改变的选项列表字段集合 (哪个选项列表发生变化就把哪个当做参数) |
| | | Map<SObject,List<String>> data = new Map<SObject,List<String>>(); |
| | | for (Account_Delay_Apply__c ada : newList) { |
| | | List<String> columsList = new List<String>(); |
| | | Account_Delay_Apply__c oldada = null; |
| | | if (Trigger.isUpdate) { |
| | | oldada = oldMap.get(ada.Id); |
| | | } |
| | | |
| | | //变更理由(可多选) |
| | | if (oldada == null || oldada.ChangeReason__c != ada.ChangeReason__c) { |
| | | columsList.add('ChangeReason__c'); |
| | | } |
| | | |
| | | data.put(ada, columsList); |
| | | } |
| | | |
| | | SplitOptionListUtil util = new SplitOptionListUtil(); |
| | | util.makeObject(data); |
| | | |
| | | } |
| | | |
| | | // //营业窗口 |
| | | // private void OpenWindow(){ |
| | | // Map<String, OCM_Management_Province__c> mpMap = new Map<String, OCM_Management_Province__c>(); |
| | | // Set<String> accOCSMset = new Set<String>(); |
| | | |
| | | // for(Account_Delay_Apply__c ada1 : newList){ |
| | | // Account_Delay_Apply__c oldada1 = null; |
| | | // if(Trigger.isUpdate){ |
| | | |
| | | // oldada1 = oldMap.get(ada1.Id); |
| | | |
| | | // if(ada1.OCM_man_province_HP__c != oldada1.OCM_man_province_HP__c){ |
| | | // accOCSMset.add(ada1.OCM_man_province_HP__c); |
| | | // } |
| | | // } |
| | | // if(Trigger.isInsert){ |
| | | // accOCSMset.add(ada1.OCM_man_province_HP__c); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | // if(null !=accOCSMset){ |
| | | // List<OCM_Management_Province__c> mpList = |
| | | // [select id, Name, Window1__c from OCM_Management_Province__c where Name =: accOCSMset]; |
| | | |
| | | // for (OCM_Management_Province__c mp : mpList) { |
| | | // mpMap.put(mp.Name, mp); |
| | | // } |
| | | // } |
| | | |
| | | // for(Account_Delay_Apply__c ada2 : newList){ |
| | | // if(Trigger.isInsert || Trigger.isUpdate){ |
| | | // if(null!=mpMap && mpMap.containsKey(ada2.OCM_man_province_HP__c)){ |
| | | // OCM_Management_Province__c omp = mpMap.get(ada2.OCM_man_province_HP__c); |
| | | // if (omp != null) { |
| | | // ada2.OpenWindow__c = omp.Window1__c; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | |
| | | // } |
| | | |
| | | //营业窗口 |
| | | private void OpenWindow1(){ |
| | | Map<String, OCM_Management_Province__c> mpMap = new Map<String, OCM_Management_Province__c>(); |
| | | List<OCM_Management_Province__c> mpList = new List<OCM_Management_Province__c>(); |
| | | Set<String> accId = new Set<String>(); |
| | | Set<String> accOCSMset = new Set<String>(); |
| | | |
| | | for(Account_Delay_Apply__c ada1 : newList){ |
| | | Account_Delay_Apply__c oldada1 = null; |
| | | if(Trigger.isInsert){ |
| | | accId.add(ada1.Hospital__c); |
| | | } |
| | | |
| | | } |
| | | |
| | | if(accId.size() > 0){ |
| | | List<Account> accList = [SELECT Id, Name, OCM_man_province_HP__c |
| | | FROM Account |
| | | WHERE id in :accId]; |
| | | for(Account acc : accList){ |
| | | accOCSMset.add(acc.OCM_man_province_HP__c); |
| | | } |
| | | |
| | | } |
| | | |
| | | if(null !=accOCSMset){ |
| | | mpList = [select id, Name, Window1__c from OCM_Management_Province__c where Name =: accOCSMset]; |
| | | } |
| | | |
| | | for(Account_Delay_Apply__c ada2 : newList){ |
| | | for(OCM_Management_Province__c omp : mpList){ |
| | | if(Trigger.isInsert){ |
| | | ada2.OpenWindow__c = omp.Window1__c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //提交时设置old字段的值 |
| | | private void setColumn(){ |
| | | |
| | | List<String> accIds = new List<String>(); |
| | | List<Account_Delay_Apply__c> alist = new List<Account_Delay_Apply__c>(); |
| | | |
| | | for (Account_Delay_Apply__c ada :newList ) { |
| | | //判断更新前后的状态(是否有效)是否不同 若不同,则判断更新后的状态是否为'审批中' |
| | | if ((ada.Is_Active__c != oldMap.get(ada.Id).Is_Active__c) && ada.Is_Active__c == '申请中' ) { |
| | | alist.add(ada); |
| | | accIds.add(ada.Hospital__c); |
| | | } |
| | | } |
| | | if (accIds.size() == 0) { |
| | | return; |
| | | }else{ |
| | | Map<String,Account> accMap = new Map<String,Account>(); |
| | | List<Account> statusList = [SELECT Id, Name, Website, Site, |
| | | Is_Active__c, Feature__c, Attribute_Type__c, Speciality_Type__c, |
| | | Abbreviation__c, Street__c, City_Master__c, Field3_companyname__c, |
| | | State_Master__c, Grade__c, Address__c, Alias_Name2__c, |
| | | Town__c, Postal_Code__c |
| | | FROM Account |
| | | WHERE id in :accIds]; |
| | | |
| | | for (Account acc :statusList ) { |
| | | accMap.put(acc.Id, acc); |
| | | } |
| | | |
| | | for (Account_Delay_Apply__c ada : alist) { |
| | | ada.Feature_old__c = accMap.get(ada.Hospital__c).Feature__c; |
| | | ada.Attribute_Type_old__c = accMap.get(ada.Hospital__c).Attribute_Type__c; |
| | | ada.Speciality_Type_old__c = accMap.get(ada.Hospital__c).Speciality_Type__c; |
| | | ada.Abbreviation_old__c = accMap.get(ada.Hospital__c).Abbreviation__c; |
| | | ada.Street_old__c = accMap.get(ada.Hospital__c).Street__c; |
| | | ada.HospitalName_old__c = accMap.get(ada.Hospital__c).Name; |
| | | ada.City_Master_old__c = accMap.get(ada.Hospital__c).City_Master__c; |
| | | ada.Field3_companyname_old__c = accMap.get(ada.Hospital__c).Field3_companyname__c; |
| | | ada.State_Master_old__c = accMap.get(ada.Hospital__c).State_Master__c; |
| | | ada.Grade_old__c = accMap.get(ada.Hospital__c).Grade__c; |
| | | //ada.Address_Together_old__c = accMap.get(ada.Hospital__c).Address__c; |
| | | ada.Website_old__c = accMap.get(ada.Hospital__c).Website; |
| | | ada.Site_old__c = accMap.get(ada.Hospital__c).Site; |
| | | ada.Alias_Name2_old__c = accMap.get(ada.Hospital__c).Alias_Name2__c; |
| | | ada.Town_old__c = accMap.get(ada.Hospital__c).Town__c; |
| | | ada.Postal_Code_old__c = accMap.get(ada.Hospital__c).Postal_Code__c; |
| | | |
| | | } |
| | | |
| | | // for (Account acc : statusList) { |
| | | // acc.Status = '申请中'; |
| | | // } |
| | | update statusList; |
| | | } |
| | | |
| | | } |
| | | |
| | | //变更有效时反写客户 |
| | | private void setAccColumn(){ |
| | | |
| | | List<String> accIds = new List<String>(); |
| | | List<String> adaIds = new List<String>(); |
| | | // List<Account_Delay_Apply__c> alist = new List<Account_Delay_Apply__c>(); |
| | | // List<Account> acclist = new List<Account>(); |
| | | List<Account> updacclist = new List<Account>(); |
| | | |
| | | for (Account_Delay_Apply__c ada :newList ) { |
| | | //判断更新前后的状态(是否有效)是否不同 若不同,则判断更新后的状态是否为'审批中' |
| | | if ((ada.Is_Active__c != oldMap.get(ada.Id).Is_Active__c) && ada.Is_Active__c == '审批通过' ) { |
| | | // alist.add(ada); |
| | | adaIds.add(ada.Id); |
| | | accIds.add(ada.Hospital__c); |
| | | } |
| | | } |
| | | if (accIds.size() == 0) { |
| | | return; |
| | | }else{ |
| | | Map<String,Account> accMap = new Map<String,Account>(); |
| | | List<Account> statusList = [SELECT Id, Name, Website, Site, |
| | | Is_Active__c, Feature__c, Attribute_Type__c, Speciality_Type__c, |
| | | Abbreviation__c, Street__c, City_Master__c, Field3_companyname__c, |
| | | State_Master__c, Grade__c, Address__c, Alias_Name2__c, |
| | | Town__c, Postal_Code__c, HospitalType__c, InstitutionalType__c,WhetherRiskPassing__c,IsUnlock__c |
| | | FROM Account |
| | | WHERE id in :accIds]; |
| | | |
| | | List<Account_Delay_Apply__c> adastatusList = [SELECT Id, Name, Website__c, Site__c, |
| | | Is_Active__c, Feature__c, Attribute_Type__c, Speciality_Type__c, |
| | | Abbreviation__c, Street__c, City_Master__c, Field3_companyname__c, |
| | | State_Master__c, Grade__c, Alias_Name2__c, |
| | | Town__c, Postal_Code__c, HospitalName__c, Hospital__c, |
| | | HospitalType__c, InstitutionalType__c,WhetherRiskPassing__c |
| | | FROM Account_Delay_Apply__c |
| | | WHERE id in :adaIds]; |
| | | |
| | | for (Account acc :statusList ) { |
| | | accMap.put(acc.Id, acc); |
| | | } |
| | | |
| | | for (Account_Delay_Apply__c ada : adastatusList) { |
| | | accMap.get(ada.Hospital__c).Feature__c = ada.Feature__c; |
| | | accMap.get(ada.Hospital__c).Attribute_Type__c = ada.Attribute_Type__c; |
| | | accMap.get(ada.Hospital__c).Speciality_Type__c = ada.Speciality_Type__c; |
| | | accMap.get(ada.Hospital__c).Abbreviation__c = ada.Abbreviation__c; |
| | | accMap.get(ada.Hospital__c).Street__c = ada.Street__c; |
| | | accMap.get(ada.Hospital__c).Name = ada.HospitalName__c; |
| | | accMap.get(ada.Hospital__c).City_Master__c = ada.City_Master__c; |
| | | accMap.get(ada.Hospital__c).Field3_companyname__c = ada.Field3_companyname__c; |
| | | accMap.get(ada.Hospital__c).State_Master__c = ada.State_Master__c; |
| | | accMap.get(ada.Hospital__c).Grade__c = ada.Grade__c; |
| | | // accMap.get(ada.Hospital__c).Address__c = ada.Address_Together__c; |
| | | accMap.get(ada.Hospital__c).Website = ada.Website__c; |
| | | accMap.get(ada.Hospital__c).Site = ada.Site__c; |
| | | accMap.get(ada.Hospital__c).Alias_Name2__c = ada.Alias_Name2__c; |
| | | accMap.get(ada.Hospital__c).Town__c = ada.Town__c; |
| | | accMap.get(ada.Hospital__c).Postal_Code__c = ada.Postal_Code__c; |
| | | |
| | | accMap.get(ada.Hospital__c).HospitalType__c = ada.HospitalType__c; |
| | | accMap.get(ada.Hospital__c).InstitutionalType__c = ada.InstitutionalType__c; |
| | | accMap.get(ada.Hospital__c).WhetherRiskPassing__c= ada.WhetherRiskPassing__c; |
| | | accMap.get(ada.Hospital__c).IsUnlock__c= true; //跳过验证规则 |
| | | system.debug('原数据==='+accMap.get(ada.Hospital__c).IsUnlock__c); |
| | | updacclist.add(accMap.get(ada.Hospital__c)); |
| | | |
| | | } |
| | | //if(updacclist.size() > 0){ |
| | | // update updacclist; |
| | | //} |
| | | if(updacclist.size()>0){ |
| | | //一个客户更新失败 |
| | | List<String> failedaccList = new List<String>(); |
| | | Database.SaveResult[] saveAccResults = Database.update(updacclist,false); |
| | | for(Integer i = 0;i<saveAccResults.size();i++) { |
| | | if(!saveAccResults.get(i).isSuccess() ){ |
| | | //将更新失败的客户添加到集合中 |
| | | failedaccList.add(String.valueOf( updacclist.get(i).id ).substring(0,15)); |
| | | } |
| | | } |
| | | |
| | | //更新成功后,清除客户上的 是否解锁 |
| | | List<Account> successAccList = new List<Account>(); |
| | | for(Account statusacc:statusList){ |
| | | if(failedaccList.contains( String.valueOf( statusacc.id ).substring(0,15) )){ |
| | | system.debug('更新失败=='+saveAccResults); |
| | | //更新失败,则不清除标识 |
| | | }else { |
| | | system.debug('清除标识==='+statusacc.IsUnlock__c); |
| | | //更新成功,清除标识 |
| | | statusacc.IsUnlock__c = false; |
| | | successAccList.add(statusacc); |
| | | } |
| | | } |
| | | |
| | | //清除标识 |
| | | if(successAccList.size()>0){ |
| | | update successAccList; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | public void CustomizePageJudge(){ |
| | | |
| | | for (Account_Delay_Apply__c ada : newList){ |
| | | System.debug('lt123-----new审批步骤-----'+ada.ApprovalSteps__c); |
| | | System.debug('lt123-----old审批步骤-----'+oldMap.get(ada.Id).ApprovalSteps__c); |
| | | if(ada.ApprovalSteps__c != oldMap.get(ada.Id).ApprovalSteps__c){ |
| | | System.debug('lt123-----审批步骤改变-----'); |
| | | if(ada.CustomizePageFlg__c == true){ |
| | | System.debug('lt123-----ada.CustomizePageFlg__c-----'+ada.CustomizePageFlg__c); |
| | | ada.CustomizePageFlg__c = false; |
| | | }else{ |
| | | System.debug('lt123-----else,ada.CustomizePageFlg__c-----'+ada.CustomizePageFlg__c); |
| | | ada.addError('请点击链接(相关项)确认具体信息后审批。'); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AccountDelayApplyHandlerTest { |
| | | @isTest |
| | | static void TestMethod1() { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | Address_Level__c al1 = new Address_Level__c(); |
| | | al1.Name = '北京'; |
| | | al1.Level1_Code__c = 'CN-99'; |
| | | al1.Level1_Sys_No__c = '999999'; |
| | | insert al1; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | insert ada; |
| | | |
| | | ada.ChangeReason__c = '其他信息修改'; |
| | | ada.State_Master__c = al1.Id; |
| | | update ada; |
| | | } |
| | | |
| | | @isTest |
| | | static void TestMethod2() { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | Address_Level__c al1 = new Address_Level__c(); |
| | | al1.Name = '北京'; |
| | | al1.Level1_Code__c = 'CN-99'; |
| | | al1.Level1_Sys_No__c = '999999'; |
| | | insert al1; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | insert ada; |
| | | |
| | | ada.ChangeReason__c = '其他信息修改'; |
| | | ada.State_Master__c = al1.Id; |
| | | ada.Is_Active__c = '申请中'; |
| | | update ada; |
| | | |
| | | ada.Is_Active__c = '审批通过'; |
| | | update ada; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | is_Alert_Qualify = false; |
| | | |
| | | if (accList != null && accList.size() > 0) { |
| | | //空指针报错修改 thh 20220411 start |
| | | //空指针报错修改 thh 20220411 start |
| | | if ('Draft'.equals(accList[0].Quolified_Approve_Status__c) |
| | | && accList[0].If_Need_Quolified__c == true) { |
| | | is_Alert_Qualify = true; |
| | | } |
| | | //空指针报错修改 thh 20220411 end |
| | | //空指针报错修改 thh 20220411 end |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | global class AccountServiceOfTarget1Hto2HBatch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | public List<String> hospId; |
| | | global AccountServiceOfTarget1Hto2HBatch() { |
| | | this.query = query; |
| | | } |
| | | global AccountServiceOfTarget1Hto2HBatch(List<String> hospId) { |
| | | this.query = query; |
| | | this.hospId = hospId; |
| | | } |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | query = 'select id,OCSM_Period_half__c,OCSM_Period__c,Account_HP__c,Account_HP__r.name,' |
| | | +' Target_Correlation_Lightsource__c,Target_Rigid_Mirror_2__c,Target_Soft_Mirror_2__c,' |
| | | +' Renew_Target_Correlation_Lightsource__c,Renew_Target_Rigid_Mirror_2__c,Renew_Target_Soft_Mirror_2__c' |
| | | +' from Account_Service_Of_Target__c where OCSM_Period_half__c = \'2H\' '; |
| | | if (this.hospId!=null && this.hospId.size()!=0) { |
| | | query +=' and Account_HP__c in :hospId'; |
| | | } |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Account_Service_Of_Target__c> asotList) { |
| | | Map<String,Account_Service_Of_Target__c> map1 = new Map<String,Account_Service_Of_Target__c>(); |
| | | Map<String,Account_Service_Of_Target__c> map2 = new Map<String,Account_Service_Of_Target__c>(); |
| | | List<Account_Service_Of_Target__c> asotUPList = new List<Account_Service_Of_Target__c>(); |
| | | List<Account_Service_Of_Target__c> asotList2 = [select id,OCSM_Period_half__c,OCSM_Period__c,Account_HP__c,Account_HP__r.name, |
| | | Target_Correlation_Lightsource__c,Target_Rigid_Mirror_2__c,Target_Soft_Mirror_2__c, |
| | | Renew_Target_Correlation_Lightsource__c,Renew_Target_Rigid_Mirror_2__c,Renew_Target_Soft_Mirror_2__c |
| | | from Account_Service_Of_Target__c where OCSM_Period_half__c = '1H']; |
| | | for (Account_Service_Of_Target__c asot :asotList ) { |
| | | map2.put(asot.Account_HP__c,asot); |
| | | system.debug('添加到map2'); |
| | | } |
| | | for (Account_Service_Of_Target__c asot :asotList2 ) { |
| | | map1.put(asot.Account_HP__c,asot); |
| | | system.debug('添加到map1'); |
| | | } |
| | | system.debug('@@@@map1='+map1); |
| | | system.debug('@@@@map2='+map2); |
| | | for ( Account_Service_Of_Target__c asot:map1.values()) { |
| | | system.debug('@@@@2H==='+map2.get(asot.Account_HP__c)); |
| | | if ( map2.get(asot.Account_HP__c) !=null) { |
| | | Account_Service_Of_Target__c asotNew = new Account_Service_Of_Target__c(); |
| | | asotNew.id = map2.get(asot.Account_HP__c).id; |
| | | asotNew.Target_Correlation_Lightsource__c = asot.Target_Correlation_Lightsource__c; |
| | | asotNew.Target_Rigid_Mirror_2__c = asot.Target_Rigid_Mirror_2__c; |
| | | asotNew.Target_Soft_Mirror_2__c = asot.Target_Soft_Mirror_2__c; |
| | | asotNew.Renew_Target_Correlation_Lightsource__c = asot.Renew_Target_Correlation_Lightsource__c; |
| | | asotNew.Renew_Target_Rigid_Mirror_2__c = asot.Renew_Target_Rigid_Mirror_2__c; |
| | | asotNew.Renew_Target_Soft_Mirror_2__c = asot.Renew_Target_Soft_Mirror_2__c; |
| | | asotUPList.add(asotNew); |
| | | } |
| | | } |
| | | if (asotUPList!=null && asotUPList.size()!=0) { |
| | | upsert asotUPList; |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AccountServiceOfTarget1Hto2HBatchTest { |
| | | static testMethod void testMethod1() { |
| | | system.Test.startTest(); |
| | | database.executeBatch(new AccountServiceOfTarget1Hto2HBatch(),200); |
| | | system.Test.stopTest(); |
| | | } |
| | | |
| | | @testSetup |
| | | private static void initData(){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com',Job_Category__c = '销售服务', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert MacOwner; |
| | | |
| | | Account hospital = new Account(); |
| | | hospital.RecordTypeId = rectCo[0].Id; |
| | | hospital.Name = 'NFM007Testhospital'; |
| | | insert hospital; |
| | | |
| | | // 戦略科室を得る |
| | | List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI']; |
| | | Account section = new Account(); |
| | | section.RecordTypeId = rectSct[0].Id; |
| | | section.Name = '*'; |
| | | section.Department_Class_Label__c = '消化科'; |
| | | section.ParentId = hospital.Id; |
| | | section.Hospital_Department_Class__c = hospital.Id; |
| | | section.AgentCode_Ext__c = '9999900'; |
| | | insert section; |
| | | |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = rectDpt[0].Id; |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'NFM007TestDepart'; |
| | | depart.ParentId = strategicDep[0].Id; |
| | | depart.Department_Class__c = strategicDep[0].Id; |
| | | depart.Hospital__c = hospital.Id; |
| | | insert depart; |
| | | |
| | | Product2 prd1 = new Product2(); |
| | | prd1.ProductCode_Ext__c = 'Prd1'; |
| | | prd1.ProductCode = 'Prd1'; |
| | | prd1.Repair_Product_Code__c = 'Prd1_RP'; |
| | | prd1.Name = 'Prd1'; |
| | | prd1.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd1.Category3__c = '纤维镜'; |
| | | prd1.Category4__c = '妇科用硬性镜'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd1.Asset_Model_No__c = '1001'; |
| | | prd1.Important_product__c = true; |
| | | prd1.Important_Rroduct_1GI__c = true; |
| | | insert prd1; |
| | | |
| | | Product2 prd2 = new Product2(); |
| | | prd2.ProductCode_Ext__c = 'Prd2'; |
| | | prd2.ProductCode = 'Prd2'; |
| | | prd2.Repair_Product_Code__c = 'Prd2_RP'; |
| | | prd2.Name = 'Prd2'; |
| | | prd2.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd2.Category3__c = '光源'; |
| | | // prd2.Category4__c = 'SD EndoEYE'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd2.Asset_Model_No__c = '1001'; |
| | | prd2.Important_product__c = true; |
| | | prd2.Important_Rroduct_1GI__c = true; |
| | | insert prd2; |
| | | |
| | | Product2 prd3 = new Product2(); |
| | | prd3.ProductCode_Ext__c = 'Prd3'; |
| | | prd3.ProductCode = 'Prd3'; |
| | | prd3.Repair_Product_Code__c = 'Prd3_RP'; |
| | | prd3.Name = 'Prd3'; |
| | | prd3.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd3.Category3__c = '纤维镜'; |
| | | // prd2.Category4__c = 'SD EndoEYE'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd3.Asset_Model_No__c = '1001'; |
| | | prd3.Important_product__c = true; |
| | | prd3.Important_Rroduct_1GI__c = true; |
| | | insert prd3; |
| | | |
| | | Product2 prd4 = new Product2(); |
| | | prd4.ProductCode_Ext__c = 'Prd4'; |
| | | prd4.ProductCode = 'Prd4'; |
| | | prd4.Repair_Product_Code__c = 'Prd4_RP'; |
| | | prd4.Name = 'Prd4'; |
| | | prd4.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd4.Category4__c = '妇科用硬性镜'; |
| | | // prd2.Category4__c = 'SD EndoEYE'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd4.Asset_Model_No__c = '1001'; |
| | | prd4.Important_product__c = true; |
| | | prd4.Important_Rroduct_1GI__c = true; |
| | | insert prd4; |
| | | |
| | | Consumable_order_details2__c saledet1 = new Consumable_order_details2__c(); |
| | | saledet1.Name = 'OCM_01_001001'; |
| | | // saledet1.Consumable_order_minor__c = Order1.Id; |
| | | saledet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | saledet1.Bar_Code__c = '0114953170032070111804001082K250BBBBB'; |
| | | // saledet1.Consumable_Product__c = prd1.Id; |
| | | saledet1.Used_account__c = section.Id; |
| | | saledet1.Delivery_List_RMB__c = 11; |
| | | saledet1.Box_Piece__c = '盒'; |
| | | saledet1.TracingCode__c = 'BBBBB'; |
| | | saledet1.SerialLotNo__c = '82K'; |
| | | saledet1.Guarantee_period_for_products__c = Date.today().addDays(5); |
| | | saledet1.Sterilization_limit__c = Date.today().addDays(5); |
| | | saledet1.Send_Date__c = null; |
| | | //saledet1.Dealer_Shipment__c = false; |
| | | saledet1.Arrive_date__c = null; |
| | | //saledet1.Dealer_Arrive__c = false; |
| | | saledet1.Used_date__c = null; |
| | | //saledet1.Dealer_Saled__c = false; |
| | | saledet1.Deliver_date__c = Date.today().addDays(-10); |
| | | insert saledet1; |
| | | |
| | | // 维修合同を作成する |
| | | Maintenance_Contract__c contract = new Maintenance_Contract__c(); |
| | | contract.Name = 'tect contract'; |
| | | contract.Hospital__c = hospital.Id; |
| | | contract.Department_Class__c = strategicDep[0].Id; |
| | | contract.Department__c = depart.Id; |
| | | contract.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract.Payment_Plan_Sum_First__c = 1; |
| | | contract.Status__c = '契約満了'; |
| | | contract.Maintenance_Contract_No__c = '11123'; |
| | | contract.recordtypeId = |
| | | Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | contract.Not_Upper_limit_reason__c = ' 1'; |
| | | contract.Contract_Start_Date__c = Date.newInstance(2021,10,5); |
| | | contract.Contract_End_Date__c = Date.newInstance(2021,11,1); |
| | | contract.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract.New_Contract_TypeF_Text__c = '续签合同'; |
| | | contract.IF_Target_Renew__c='1'; |
| | | contract.Contract_Conclusion_Date__c=Date.newInstance(2021,10,5); |
| | | system.assertEquals(contract.Contract_End_Date__c >= Date.newInstance(2021,10,1) && contract.Contract_End_Date__c <= Date.newInstance(2022,9,30),true); |
| | | insert contract; |
| | | |
| | | Maintenance_Contract__c contract2 = new Maintenance_Contract__c(); |
| | | contract2.Name = 'tect contract2'; |
| | | contract2.Hospital__c = hospital.Id; |
| | | contract2.Department_Class__c = strategicDep[0].Id; |
| | | contract2.Department__c = depart.Id; |
| | | contract2.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract2.Payment_Plan_Sum_First__c = 1; |
| | | contract2.Status__c = '契約'; |
| | | contract2.Maintenance_Contract_No__c = '11123111'; |
| | | contract2.Not_Upper_limit_reason__c = ' 2'; |
| | | contract2.Contract_Start_Date__c = Date.newInstance(2021,10,5); |
| | | contract2.Contract_End_Date__c = Date.newInstance(2021,11,1); |
| | | contract2.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract2.IF_Target_Renew__c='1'; |
| | | contract2.Contract_Conclusion_Date__c=Date.newInstance(2021,10,5); |
| | | system.assertEquals(contract2.Contract_End_Date__c >= Date.newInstance(2021,10,1) && contract2.Contract_End_Date__c <= Date.newInstance(2022,9,30),true); |
| | | insert contract2; |
| | | |
| | | asset ast = new asset(); |
| | | ast.Name = prd1.Name; |
| | | ast.Product2Id = prd1.Id; |
| | | ast.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast.TracingCode__c = saledet1.TracingCode__c; |
| | | ast.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast.Barcode__c = saledet1.Bar_Code__c; |
| | | ast.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast.Asset_Owner__c = '经销商资产'; |
| | | ast.AccountId = depart.Id; |
| | | ast.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast.Hospital__c = hospital.Id; |
| | | ast.CurrentContract__c = contract.Id; |
| | | ast.CurrentContract_Asset_Price__c = 0; |
| | | ast.CurrentContract_F__c=contract.Id; |
| | | insert ast; |
| | | |
| | | asset ast1 = new asset(); |
| | | ast1.Name = prd2.Name; |
| | | ast1.Product2Id = prd2.Id; |
| | | ast1.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast1.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast1.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast1.TracingCode__c = saledet1.TracingCode__c; |
| | | ast1.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast1.Barcode__c = saledet1.Bar_Code__c; |
| | | ast1.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast1.Asset_Owner__c = '经销商资产'; |
| | | ast1.AccountId = depart.Id; |
| | | ast1.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast1.Hospital__c = hospital.Id; |
| | | ast1.CurrentContract__c = contract2.Id; |
| | | ast1.CurrentContract_Asset_Price__c = 0; |
| | | insert ast1; |
| | | |
| | | asset ast2 = new asset(); |
| | | ast2.Name = prd3.Name; |
| | | ast2.Product2Id = prd3.Id; |
| | | ast2.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast2.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast2.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast2.TracingCode__c = saledet1.TracingCode__c; |
| | | ast2.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast2.Barcode__c = saledet1.Bar_Code__c; |
| | | ast2.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast2.Asset_Owner__c = '经销商资产'; |
| | | ast2.AccountId = depart.Id; |
| | | ast2.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast2.Hospital__c = hospital.Id; |
| | | ast2.CurrentContract__c = contract.Id; |
| | | ast2.CurrentContract_Asset_Price__c = 0; |
| | | insert ast2; |
| | | |
| | | asset ast3 = new asset(); |
| | | ast3.Name = prd4.Name; |
| | | ast3.Product2Id = prd4.Id; |
| | | ast3.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast3.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast3.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast3.TracingCode__c = saledet1.TracingCode__c; |
| | | ast3.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast3.Barcode__c = saledet1.Bar_Code__c; |
| | | ast3.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast3.Asset_Owner__c = '经销商资产'; |
| | | ast3.AccountId = depart.Id; |
| | | ast3.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast3.Hospital__c = hospital.Id; |
| | | ast3.CurrentContract__c = contract.Id; |
| | | ast3.CurrentContract_Asset_Price__c = 0; |
| | | insert ast3; |
| | | |
| | | |
| | | Account_Service_Of_Target__c asot=new Account_Service_Of_Target__c(); |
| | | asot.OCSM_Period_half__c='2H'; |
| | | asot.Account_HP__c=hospital.Id; |
| | | insert asot; |
| | | Account_Service_Of_Target__c asot2=new Account_Service_Of_Target__c(); |
| | | asot2.OCSM_Period_half__c='1H'; |
| | | asot2.Account_HP__c=hospital.Id; |
| | | insert asot2; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | // 测试类 AdvanceOpportunityTest |
| | | public with sharing class AdvanceOpportunityController { |
| | | public AdvanceOpportunityController(ApexPages.StandardController stdController) { |
| | | AdOpportunity = new Advance_Opportunity__c(); |
| | | } |
| | | public Advance_Opportunity__c AdOpportunity{get; set;} |
| | | public Boolean hasError { get; private set; } |
| | | public String aoId {get; set;} |
| | | public void init(){ |
| | | aoId = ApexPages.currentPage().getParameters().get('id'); |
| | | // 20220620 ljh update SWAG-CFK9YX start |
| | | // List<Advance_Opportunity__c> aoList = [SELECT Id,MarketAdvance__c,AddOpportunity__c,BigContract__c,GradePro__c,AddPrice__c,Opportunity__c FROM Advance_Opportunity__c WHERE Opportunity__c = :aoId]; |
| | | List<Advance_Opportunity__c> aoList = [SELECT Id,MarketAdvance__c,KeepPushing__c,BigContract__c,GradePro__c,AddPrice__c,Opportunity__c FROM Advance_Opportunity__c WHERE Opportunity__c = :aoId]; |
| | | // 20220620 ljh update SWAG-CFK9YX edn |
| | | if (aoList.size() == 0) { |
| | | |
| | | } else{ |
| | | AdOpportunity = aoList[0]; |
| | | } |
| | | } |
| | | public void save(){ |
| | | hasError = true; |
| | | try { |
| | | if (String.isBlank(AdOpportunity.Opportunity__c)) { |
| | | AdOpportunity.Opportunity__c = aoId; |
| | | } |
| | | // AdOpportunity.Name = 'ceshi'; |
| | | upsert AdOpportunity; |
| | | hasError=false; |
| | | } catch (Exception ex) { |
| | | system.debug('=====' + ex.getMessage()); |
| | | ApexPages.addMessages(ex); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>41.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AdvanceOpportunityTest { |
| | | static final String RC_BYOUIN = '病院'; |
| | | static final String RC_HANBAOITEN = '販売店'; |
| | | static final String RC_KEIYAKU = '契約'; |
| | | static testMethod void testMethod1() { |
| | | |
| | | } |
| | | @isTest |
| | | static void test_1(){ |
| | | RecordType recByoin = [select id from RecordType where IsActive = true and SobjectType= 'Account' and Name=:RC_BYOUIN limit 1]; |
| | | Account hospital = new Account(Name = 'テスト病院'); |
| | | hospital.RecordTypeId = recByoin.id; |
| | | hospital.Site = 'テスト病院部門'; |
| | | hospital.Alias_Name2__c = 'テスト病院別名'; |
| | | insert hospital; |
| | | |
| | | RecordType recHanbaiten = [select id from RecordType where IsActive = true and SobjectType= 'Account' and Name=:RC_HANBAOITEN limit 1]; |
| | | Account sellerA = new Account(Name = '販売店'); |
| | | sellerA.RecordTypeId = recHanbaiten.id; |
| | | sellerA.Hospital__c = hospital.id; |
| | | sellerA.Business_Paper_Expiration_Date__c = Date.today().addDays(20); |
| | | insert sellerA; |
| | | |
| | | RecordType recKeiyaku = [select id from RecordType where IsActive = true and SobjectType= 'Account' and Name=:RC_KEIYAKU limit 1]; |
| | | Account contractA = new Account(Name = '*'); |
| | | contractA.RecordTypeId = recKeiyaku.id; |
| | | contractA.Agent_Ref__c = sellerA.id; |
| | | contractA.ParentId = sellerA.id; |
| | | insert contractA; |
| | | System.Test.startTest(); |
| | | Opportunity opp = new Opportunity( Name='aiueo', StageName='contact', CloseDate=Date.today()); |
| | | opp.Trade__c = '内貿'; |
| | | //opp.CurrencyIsoCode = CurrencyIso; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.StageName = '引合'; |
| | | opp.Fixed_Check__c = false; |
| | | opp.owner_not_automatically_update__c = true; |
| | | //opp.Pricebook2Id = pricebook.id; |
| | | opp.Purchase_Type__c = '一般引合'; |
| | | opp.Promise_Class__c = '内貿'; |
| | | opp.Fund_Basis__c = '政府資金'; |
| | | opp.AccountId = contractA.id; |
| | | opp.Hospital__c = contractA.id; |
| | | opp.Agency1__c = sellerA.id; |
| | | opp.Wholesale_Price__c = 9000; |
| | | opp.Opportunity_stage__c = '还没申请预算'; |
| | | opp.Close_Forecasted_Date__c = Date.today().addDays(50); |
| | | opp.Special_Opp_lanhai__c = false; |
| | | insert opp; |
| | | |
| | | AdvanceOpportunityController aoc = new AdvanceOpportunityController(new ApexPages.StandardController(opp)); |
| | | Advance_Opportunity__c ado = new Advance_Opportunity__c(); |
| | | // ado.Name = 'test'; |
| | | ado.Opportunity__c = opp.Id; |
| | | insert ado; |
| | | aoc.init(); |
| | | ado.BigContract__c = true; |
| | | upsert ado; |
| | | aoc.save(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>41.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | } |
| | | |
| | | protected override void beforeInsert() { |
| | | beforeSetValue(); |
| | | //zhj MEBG新方案改造 2022-11-30 start |
| | | //beforeSetValue(); |
| | | //zhj MEBG新方案改造 2022-11-30 end |
| | | } |
| | | protected override void beforeUpdate() { |
| | | beforeSetValue(); |
| | | //zhj MEBG新方案改造 2022-11-30 start |
| | | //beforeSetValue(); |
| | | //zhj MEBG新方案改造 2022-11-30 end |
| | | shareAgency_Contact_ToRole(this.newList); |
| | | } |
| | | |
| | |
| | | shareAgency_Contact_ToRole(this.newList); |
| | | } |
| | | |
| | | private void beforeSetValue() { |
| | | Set<String> nameSet = new Set<String>(); |
| | | Set<String> ahIdSet = new Set<String>(); |
| | | Map<String, Agency_Contact__c> keyMap = new Map<String, Agency_Contact__c>(); |
| | | for (Agency_Contact__c nObj : newList) { |
| | | if (String.isBlank(nObj.Agency_ID__c)) { |
| | | if (String.isBlank(nObj.getCloneSourceId()) == false) { |
| | | // 要注意 画面からしかないので、ここで selectする |
| | | Agency_Contact__c srcObj = [Select Id, Agency_Hospital__c, Contact__c, Hospital_ID18__c, Hospital_Name__c from Agency_Contact__c where Id = :nObj.getCloneSourceId()]; |
| | | if (String.isBlank(nObj.Agency_Hospital__c) == false |
| | | && String.isBlank(srcObj.Agency_Hospital__c) |
| | | && nObj.Hospital_ID18__c != srcObj.Hospital_ID18__c) { |
| | | nObj.Agency_Hospital__c.addError('请选择:' + srcObj.Hospital_Name__c); |
| | | } |
| | | if (String.isBlank(srcObj.Contact__c) == false) { |
| | | nObj.Contact__c = srcObj.Contact__c; |
| | | } |
| | | } |
| | | nObj.Agency_ID__c = nObj.Agency_ID_F__c; |
| | | } |
| | | nameSet.add(nObj.Name_Encrypted__c); |
| | | ahIdSet.add(nObj.Agency_Hospital__c); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | // keyMap.put(nObj.Agency_Hospital__c + nObj.Name, nObj); |
| | | keyMap.put(nObj.Agency_Hospital__c + nObj.Name_Encrypted__c, nObj); |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | } |
| | | //zhj MEBG新方案改造 2022-11-30 start |
| | | // private void beforeSetValue() { |
| | | // Set<String> nameSet = new Set<String>(); |
| | | // Set<String> ahIdSet = new Set<String>(); |
| | | // Map<String, Agency_Contact__c> keyMap = new Map<String, Agency_Contact__c>(); |
| | | // for (Agency_Contact__c nObj : newList) { |
| | | // if (String.isBlank(nObj.Agency_ID__c)) { |
| | | // if (String.isBlank(nObj.getCloneSourceId()) == false) { |
| | | // // 要注意 画面からしかないので、ここで selectする |
| | | // Agency_Contact__c srcObj = [Select Id, Agency_Hospital__c, Contact__c, Hospital_ID18__c, Hospital_Name__c from Agency_Contact__c where Id = :nObj.getCloneSourceId()]; |
| | | // if (String.isBlank(nObj.Agency_Hospital__c) == false |
| | | // && String.isBlank(srcObj.Agency_Hospital__c) |
| | | // && nObj.Hospital_ID18__c != srcObj.Hospital_ID18__c) { |
| | | // nObj.Agency_Hospital__c.addError('请选择:' + srcObj.Hospital_Name__c); |
| | | // } |
| | | // if (String.isBlank(srcObj.Contact__c) == false) { |
| | | // nObj.Contact__c = srcObj.Contact__c; |
| | | // } |
| | | // } |
| | | // nObj.Agency_ID__c = nObj.Agency_ID_F__c; |
| | | // } |
| | | // nameSet.add(nObj.Name_Encrypted__c); |
| | | // ahIdSet.add(nObj.Agency_Hospital__c); |
| | | // // PIPL update Yin Mingjie 21/02/2022 start |
| | | // // keyMap.put(nObj.Agency_Hospital__c + nObj.Name, nObj); |
| | | // keyMap.put(nObj.Agency_Hospital__c + nObj.Name_Encrypted__c, nObj); |
| | | // // PIPL update Yin Mingjie 21/02/2022 end |
| | | // } |
| | | |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | // List<Agency_Contact__c> ars = [select Id, Agency_Hospital__r.Name, Agency_Hospital__c, Name from Agency_Contact__c |
| | | // where Name in :nameSet and Agency_Hospital__c in :ahIdSet and Agency_Hospital__c != null]; |
| | | List<Agency_Contact__c> ars = [select Id, Agency_Hospital__r.Name, Agency_Hospital__c, Name, Name_Encrypted__c from Agency_Contact__c |
| | | where Name_Encrypted__c in :nameSet and Agency_Hospital__c in :ahIdSet and Agency_Hospital__c != null]; |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | for (Agency_Contact__c ar : ars) { |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | // String key = ar.Agency_Hospital__c + ar.Name; |
| | | String key = ar.Agency_Hospital__c + ar.Name_Encrypted__c; |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | //system.debug('========3333333key'+key); |
| | | if (keyMap.containsKey(key)) { |
| | | Agency_Contact__c a = keyMap.get(key); |
| | | if (a.Id == ar.Id) continue; |
| | | //system.debug('========3333333'); |
| | | a.addError('该客户人员名字已存在,在'+ar.Agency_Hospital__r.Name+'医院,请修改'); |
| | | } |
| | | } |
| | | } |
| | | // // PIPL update Yin Mingjie 21/02/2022 start |
| | | // // List<Agency_Contact__c> ars = [select Id, Agency_Hospital__r.Name, Agency_Hospital__c, Name from Agency_Contact__c |
| | | // // where Name in :nameSet and Agency_Hospital__c in :ahIdSet and Agency_Hospital__c != null]; |
| | | // List<Agency_Contact__c> ars = [select Id, Agency_Hospital__r.Name, Agency_Hospital__c, Name, Name_Encrypted__c from Agency_Contact__c |
| | | // where Name_Encrypted__c in :nameSet and Agency_Hospital__c in :ahIdSet and Agency_Hospital__c != null]; |
| | | // // PIPL update Yin Mingjie 21/02/2022 end |
| | | // for (Agency_Contact__c ar : ars) { |
| | | // // PIPL update Yin Mingjie 21/02/2022 start |
| | | // // String key = ar.Agency_Hospital__c + ar.Name; |
| | | // String key = ar.Agency_Hospital__c + ar.Name_Encrypted__c; |
| | | // // PIPL update Yin Mingjie 21/02/2022 end |
| | | // //system.debug('========3333333key'+key); |
| | | // if (keyMap.containsKey(key)) { |
| | | // Agency_Contact__c a = keyMap.get(key); |
| | | // if (a.Id == ar.Id) continue; |
| | | // //system.debug('========3333333'); |
| | | // a.addError('该客户人员名字已存在,在'+ar.Agency_Hospital__r.Name+'医院,请修改'); |
| | | // } |
| | | // } |
| | | // } |
| | | //zhj MEBG新方案改造 2022-11-30 end |
| | | |
| | | /** |
| | | * 设定 apex share to role |
| | |
| | | set_AgencyOpportunity_OCSMOwner(); |
| | | |
| | | if (updAgencyOpportunityMap.size() > 0) { |
| | | // 跳过询价trigger |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | update updAgencyOpportunityMap.values(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | } |
| | | } |
| | | |
| | |
| | | set_AgencyOpportunity_OCSMOwner(); |
| | | |
| | | if (updAgencyOpportunityMap.size() > 0) { |
| | | // 跳过询价trigger |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | update updAgencyOpportunityMap.values(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | } |
| | | |
| | | updateTask(); // 2022-6-27 yjk 询价任务 |
| | | } |
| | | |
| | | |
| | | //2022-6-27 yjk 询价任务 start |
| | | private void updateTask() { |
| | | List<Id> oppIds = new List<Id>(); |
| | | List<Id> canceloppIds = new List<Id>();//20221208 you DB202211594688 |
| | | |
| | | List<Opportunity> opList = new List<Opportunity>(); |
| | | for(Opportunity opp : newList){ |
| | | //if(opp.IF_Submit__c == true && oldMap.get(opp.id).IF_Submit__c ==false){ |
| | | if(opp.Assistant_Applied_Date__c != null && oldMap.get(opp.id).Assistant_Applied_Date__c == null){ |
| | | oppIds.add(opp.id); |
| | | Opportunity op = new Opportunity(); |
| | | op.Id = opp.Id; |
| | | op.ConfirmationofAward_createTime__c = (opp.Task_createTime__c !=null || opp.ifOpenBid__c =='非公开招标') ? Date.today() : null; //20220823 you |
| | | op.ConfirmationofAward__c = 'OLY中标'; |
| | | opList.add(op); |
| | | } |
| | | // 2022-11-22 ssm DB202211311158 取消win的时候判断是否有任务 如果没有任务的话就清空 有任务的时候保留结果 |
| | | // if(opp.Assistant_Applied_Date__c == null && oldMap.get(opp.id).Assistant_Applied_Date__c != null){//取消合同申请日,字段清空 |
| | | if(opp.Assistant_Applied_Date__c == null && oldMap.get(opp.id).Assistant_Applied_Date__c != null && |
| | | !(!opp.SAP_Send_OK__c && oldMap.get(opp.id).SAP_Send_OK__c && oldMap.get(opp.id).Task_createTime__c != null)){ |
| | | Opportunity op = new Opportunity(); |
| | | op.Id = opp.Id; |
| | | op.ConfirmationofAward_createTime__c = null; |
| | | op.ConfirmationofAward__c = ''; |
| | | opList.add(op); |
| | | } |
| | | if(opp.ConfirmationofAward__c != null && oldMap.get(opp.id).ConfirmationofAward__c == null){ |
| | | oppIds.add(opp.id); |
| | | } |
| | | //20221208 you DB202211594688 取消 未完成的失单报告任务 |
| | | if(opp.ConfirmationofAward__c != null && oldMap.get(opp.id).ConfirmationofAward__c !=null && oldMap.get(opp.id).ConfirmationofAward__c=='竞争对手中标' && opp.ConfirmationofAward__c=='OLY中标' && opp.LostTask_createTime__c !=null && opp.LostTask_comfirmTime__c ==null){ |
| | | canceloppIds.add(opp.id); |
| | | } |
| | | |
| | | } |
| | | |
| | | List<task__c> taskList = [select id,taskStatus__c ,OpportunityId__c,RecordType.Name from task__c where ((RecordType.Name in ('中标结果确认') and OpportunityId__c in :oppIds) OR (RecordType.Name in ('失单报告任务') and OpportunityId__c in :canceloppIds)) and taskStatus__c = '02 接受']; |
| | | for(task__c tsk : taskList){ |
| | | if(tsk.RecordType.Name=='失单报告任务'){ |
| | | tsk.taskStatus__c = '04 取消'; |
| | | tsk.cancelDate__c = date.today(); |
| | | tsk.cancelReasonSelect__c = '修改中标结果'; |
| | | Opportunity op = new Opportunity(); |
| | | op.Id = tsk.OpportunityId__c; |
| | | op.LostTask_createTime__c =null; |
| | | opList.add(op); |
| | | }else{ |
| | | tsk.taskStatus__c = '03 完成'; |
| | | } |
| | | |
| | | } |
| | | if(null!=opList && opList.size()>0){ |
| | | update opList; |
| | | } |
| | | |
| | | update taskList; |
| | | } |
| | | |
| | | //2022-6-27 yjk 询价任务 end |
| | | |
| | | //private void insertOppFromAgencyOpportunity() { |
| | | // for(Opportunity nObj : newList) { |
| | |
| | | // 询价 Win 的时候 更新 .询价 的 Amount__c = oppMap.get(ao.Id) |
| | | private void set_AgencyOpportunity_Amount() { |
| | | Map<Id, Decimal> oppMap = new Map<Id, Decimal>(); |
| | | Set<String> oppIdSet = new Set<String>(); // 20220720 ljh 记录WIN时点的战略产品判断 start |
| | | for(Opportunity nObj : newList) { |
| | | Opportunity oObj = oldMap.get(nObj.Id); |
| | | if(nObj.Agency_Opportunity__c != null && nObj.AgencyOpp_FromOCM__c == true && oObj.SAP_Send_OK__c == false && nObj.SAP_Send_OK__c == true) { |
| | | oppMap.put(nObj.Agency_Opportunity__c, nObj.Dealer_Final_Price__c); |
| | | // 20220720 ljh 记录WIN时点的战略产品判断 start |
| | | // if(nObj.Agency_Opportunity__c != null && nObj.AgencyOpp_FromOCM__c == true && oObj.SAP_Send_OK__c == false && nObj.SAP_Send_OK__c == true) { |
| | | // oppMap.put(nObj.Agency_Opportunity__c, nObj.Dealer_Final_Price__c); |
| | | // } |
| | | if( oObj.SAP_Send_OK__c == false && nObj.SAP_Send_OK__c == true) { |
| | | if(nObj.Agency_Opportunity__c != null && nObj.AgencyOpp_FromOCM__c == true){ |
| | | oppMap.put(nObj.Agency_Opportunity__c, nObj.Dealer_Final_Price__c); |
| | | } |
| | | oppIdSet.add(nObj.Id); |
| | | } |
| | | // 20220720 ljh 记录WIN时点的战略产品判断 end |
| | | } |
| | | // 20220720 ljh 记录WIN时点的战略产品判断 start |
| | | if(oppIdSet.size() > 0 ){ |
| | | List<OpportunityLineItem> OppLIlist = [select Id,Key_product_147P_Text__c,Key_product_147P__c from OpportunityLineItem where OpportunityId in :oppIdSet]; |
| | | for(OpportunityLineItem oli : OppLIlist){ |
| | | oli.Key_product_147P_Text__c = oli.Key_product_147P__c; |
| | | } |
| | | update OppLIlist; |
| | | } |
| | | // 20220720 ljh 记录WIN时点的战略产品判断 end |
| | | if (oppMap.size() > 0) { |
| | | List<Agency_Opportunity__c> aoList = [select Id, Name, Amount__c from Agency_Opportunity__c where Id in :oppMap.keySet()]; |
| | | for(Agency_Opportunity__c ao : aoList) { |
| | |
| | | } |
| | | |
| | | } |
| | | @TestVisible |
| | | public static void testI() { |
| | | integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| | |
| | | public static User user2 = new User(); |
| | | public static Contact contact2 = new Contact(); |
| | | public static Contact contact = new Contact(); |
| | | |
| | | static testMethod void testMethod1() { |
| | | AgencyOppUpdHandler.testI(); |
| | | } |
| | | |
| | | static testMethod void test_method() { |
| | | // 取引先 |
| | |
| | | System.assertEquals(10, accTestList.size()); |
| | | System.assertEquals('test1医院', accTestList[0].Name); |
| | | |
| | | //经销商医院データを作る |
| | | aHosLink.Name = 'test1经销商医院'; |
| | | aHosLink.Hospital__c = account1.Id; |
| | | aHosLink.Agency__c = account2.Id; |
| | | insert aHosLink; |
| | | |
| | | |
| | | //取引先責任者 |
| | | contact2.AccountId = account2.Id; |
| | |
| | | |
| | | //System.assertEquals('test1经销商', co.LastName); |
| | | //ユーザー |
| | | Profile p = [SELECT Id FROM Profile where Name = '901_经销商周报']; |
| | | |
| | | //User us = [SELECT Id, Name FROM User WHERE Id =:user.Id]; |
| | | //System.assertEquals('test_user@example.com', user.Email); |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | Profile p = [SELECT Id FROM Profile where Name = '901_经销商活动系统'];//'901_经销商周报']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact2.Id; |
| | | user.FirstName = 'ユーザー'; |
| | |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | insert user; |
| | | User us = [SELECT Id, Name FROM User WHERE Id =:user.Id]; |
| | | System.assertEquals('test_user@example.com', user.Email); |
| | | |
| | | //经销商医院データを作る |
| | | aHosLink.Name = 'test1经销商医院'; |
| | | aHosLink.Hospital__c = account1.Id; |
| | | aHosLink.Agency__c = account2.Id; |
| | | aHosLink.Agency_Campaign_Obj__c =true; |
| | | aHosLink.OwnerId = user.Id; |
| | | insert aHosLink; |
| | | |
| | | Id rtId = [select Id,DeveloperName from RecordType where IsActive = true and SobjectType = 'Agency_Opportunity__c' and DeveloperName = 'Opportunity'].Id; |
| | | agency_Opp.RecordTypeId = rtId; |
| | |
| | | opp.Agency_Opportunity__c = agency_Opp.Id; |
| | | opp.Name = 'test询价'; |
| | | opp.StageName = '目標'; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | |
| | | Test.startTest(); |
| | | insert opp; |
| | |
| | | Test.stopTest(); |
| | | Opportunity opptest = [SELECT Id, Name FROM Opportunity WHERE Id =:opp.Id]; |
| | | System.assertEquals('::test询价', opptest.Name); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | System.assertEquals(10, accTestList.size()); |
| | | System.assertEquals('test1医院', accTestList[0].Name); |
| | | |
| | | //经销商医院データを作る |
| | | aHosLink.Name = 'test1经销商医院'; |
| | | aHosLink.Hospital__c = account1.Id; |
| | | aHosLink.Agency__c = account2.Id; |
| | | insert aHosLink; |
| | | |
| | | |
| | | //取引先責任者 |
| | | contact2.AccountId = account2.Id; |
| | |
| | | |
| | | //System.assertEquals('test1经销商', co.LastName); |
| | | //ユーザー |
| | | Profile p = [SELECT Id FROM Profile where Name = '901_经销商周报']; |
| | | |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | Profile p = [SELECT Id FROM Profile where Name = '901_经销商活动系统'];//'901_经销商周报']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact2.Id; |
| | | user.FirstName = 'ユーザー'; |
| | |
| | | insert user; |
| | | User us = [SELECT Id, Name FROM User WHERE Id =:user.Id]; |
| | | System.assertEquals('test_user@example.com', user.Email); |
| | | |
| | | //经销商医院データを作る |
| | | aHosLink.Name = 'test1经销商医院'; |
| | | aHosLink.Hospital__c = account1.Id; |
| | | aHosLink.Agency__c = account2.Id; |
| | | aHosLink.Agency_Campaign_Obj__c =true; |
| | | aHosLink.OwnerId = user.Id; |
| | | insert aHosLink; |
| | | Id rtId = [select Id,DeveloperName from RecordType where IsActive = true and SobjectType = 'Agency_Opportunity__c' and DeveloperName = 'Opportunity'].Id; |
| | | agency_Opp.RecordTypeId = rtId; |
| | | agency_Opp.Name = '引合1'; |
| | |
| | | opp.StageName = '目標'; |
| | | //opp.AgencyOpp_FromOCM__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | |
| | | Test.startTest(); |
| | | insert opp; |
| | |
| | | Test.stopTest(); |
| | | Opportunity opptest = [SELECT Id, Name FROM Opportunity WHERE Id =:opp.Id]; |
| | | System.assertEquals('::test询价', opptest.Name); |
| | | } |
| | | } |
| | | |
| | | //Opportunity Owner変更 OCSM_Owner__cも変更 |
| | |
| | | |
| | | //System.assertEquals('test1经销商', co.LastName); |
| | | //ユーザー |
| | | Profile p = [SELECT Id FROM Profile where Name = '901_经销商周报']; |
| | | |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | Profile p = [SELECT Id FROM Profile where Name = '901_经销商活动系统']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact2.Id; |
| | | user.FirstName = 'ユーザー'; |
| | |
| | | , ProfileId = adminP1.id); |
| | | |
| | | insert new List<User> {user, user2}; |
| | | |
| | | //经销商医院データを作る |
| | | aHosLink.Name = 'test1经销商医院'; |
| | | aHosLink.Hospital__c = account1.Id; |
| | | aHosLink.Agency__c = account2.Id; |
| | | aHosLink.OwnerId = user.Id; |
| | | aHosLink.Agency_Campaign_Obj__c =true; |
| | | insert aHosLink; |
| | | |
| | | Id rtId = [select Id,DeveloperName from RecordType where IsActive = true and SobjectType = 'Agency_Opportunity__c' and DeveloperName = 'Opportunity'].Id; |
| | |
| | | opp.Name = 'test询价'; |
| | | opp.StageName = '目標'; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | opp.SAP_Send_OK__c = true; |
| | | insert opp; |
| | | |
| | | Test.startTest(); |
| | | //updAgencyOpportunityMap |
| | | opp.Agency_Opportunity__c = agency_Opp.Id; |
| | | update opp; |
| | | // opp.Agency_Opportunity__c = agency_Opp.Id; |
| | | // update opp; |
| | | |
| | | agency_Opp.NewOpportunity_Agency_Apply_Status__c = '批准'; |
| | | agency_Opp.Change_To_Opportunity__c = opp.Id; |
| | | update agency_Opp; |
| | | |
| | | //Owner変更 |
| | | opp.owner_not_automatically_update__c = true; |
| | | opp.OwnerId = user2.Id; |
| | | update opp; |
| | | //opp.owner_not_automatically_update__c = true; |
| | | //opp.OwnerId = user2.Id; |
| | | //update opp; |
| | | Test.stopTest(); |
| | | |
| | | Agency_Opportunity__c agencyopportunity = [SELECT |
| | | Id,Name,OCSM_Owner__c,Change_To_Opportunity__c, Department_Class_Opp__c |
| | | FROM Agency_Opportunity__c WHERE Id =: agency_Opp.Id]; |
| | | System.assertNotEquals(agencyopportunity.Department_Class_Opp__c, null); |
| | | System.assertEquals(user2.Id, opp.OwnerId); |
| | | System.assertEquals(user2.Id, agencyopportunity.OCSM_Owner__c); |
| | | //System.assertEquals(user2.Id, opp.OwnerId); |
| | | //System.assertEquals(user2.Id, agencyopportunity.OCSM_Owner__c); |
| | | |
| | | String rowCause = Schema.Agency_Opportunity__Share.RowCause.OCSM_Owner_c_User__c; |
| | | List<Agency_Opportunity__Share> agencyopportunityShare = [SELECT |
| | |
| | | AND RowCause = :rowCause]; |
| | | System.assertEquals(1, agencyopportunityShare.size()); |
| | | System.assertEquals('OCSM_Owner_c_User__c', agencyopportunityShare[0].RowCause); |
| | | System.assertEquals(user2.Id, agencyopportunityShare[0].UserOrGroupId); |
| | | //System.assertEquals(user2.Id, agencyopportunityShare[0].UserOrGroupId); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // FIXME develoerNameより |
| | | /*20230214 you DB202302187947 101去掉一个sql |
| | | String[] deptTypes = new String[] {'Department_Class_OTH', 'Department_Class_BF', 'Department_Class_GYN', 'Department_Class_GS', 'Department_Class_URO', 'Department_Class_GI', 'Department_Class_ENT', 'Department_Class_ET'}; |
| | | List<RecordType> deptRects = [select Id, DeveloperName from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN :deptTypes]; |
| | | Map<String, String> deptRectMap = new Map<String, String>(); |
| | |
| | | deptRectMap.put('ET', rect.Id); |
| | | } |
| | | } |
| | | */ |
| | | //添加新逻辑 start |
| | | String[] deptTypes = new String[] {'Department_Class_OTH', 'Department_Class_BF', 'Department_Class_GYN', 'Department_Class_GS', 'Department_Class_URO', 'Department_Class_GI', 'Department_Class_ENT', 'Department_Class_ET'}; |
| | | Map<String, String> deptRectMap = new Map<String, String>(); |
| | | Map<String, Schema.RecordTypeInfo> deptrectAllMap = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName(); |
| | | for (string rect : deptTypes) { |
| | | ID accid=deptrectAllMap.get(rect).getRecordTypeId(); |
| | | if (rect == 'Department_Class_OTH') { |
| | | deptRectMap.put('OTH', accid); |
| | | } else if (rect == 'Department_Class_BF') { |
| | | deptRectMap.put('BF', accid); |
| | | } else if (rect == 'Department_Class_GYN') { |
| | | deptRectMap.put('GYN', accid); |
| | | } else if (rect == 'Department_Class_GS') { |
| | | deptRectMap.put('GS', accid); |
| | | } else if (rect == 'Department_Class_URO') { |
| | | deptRectMap.put('URO', accid); |
| | | } else if (rect == 'Department_Class_GI') { |
| | | deptRectMap.put('GI', accid); |
| | | } else if (rect == 'Department_Class_ENT') { |
| | | deptRectMap.put('ENT', accid); |
| | | } else if (rect == 'Department_Class_ET') { |
| | | deptRectMap.put('ET', accid); |
| | | } |
| | | } |
| | | //添加新逻辑 end |
| | | |
| | | Map<Id, Id> ahMap = new Map<Id, Id>(); |
| | | List<Agency_Hospital_Link__c> ahlist = [select Id, Hospital__c from Agency_Hospital_Link__c where Id in :ahId]; |
| | |
| | | insert new List<contact> {contact1,contact2,contact3}; |
| | | |
| | | Test.startTest(); |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | // ユーザー |
| | | //Profile p = [select Id from Profile where Name = '901_经销商周报']; |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | |
| | | opp.StageName = '目標'; |
| | | //opp.AgencyOpp_FromOCM__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | insert opp; |
| | | opp.SAP_Send_OK__c = true; |
| | | |
| | |
| | | opp2.Name = 'test询价2'; |
| | | opp2.StageName = '目標2'; |
| | | opp2.SAP_Send_OK__c = false; |
| | | opp2.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp2.CloseDate = Date.newInstance(2023, 7, 15); |
| | | opp2.SAP_Send_OK__c = true; |
| | | |
| | | // Test.startTest(); |
| | |
| | | FROM Agency_Opportunity__Share |
| | | WHERE ParentId=:agency_opportunity.Id and RowCause <>:rowCause]; |
| | | System.assertEquals(user.Id, agencyopportunityShare[0].UserOrGroupId); |
| | | } |
| | | } |
| | | |
| | | // 经销商所有者テスト |
| | |
| | | insert new List<contact> {contact1,contact2,contact3}; |
| | | //insert new List<contact> {contact1,contact2}; |
| | | |
| | | |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | // ユーザー |
| | | //Profile p = [select Id from Profile where Name = '901_经销商周报']; |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | |
| | | opp.StageName = '目標'; |
| | | //opp.AgencyOpp_FromOCM__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | opp.OwnerId = user.Id; |
| | | insert opp; |
| | | |
| | |
| | | System.assertEquals(userList[0].SalesManager__c, aoList[0].Sales_Manager_F__c); |
| | | //System.assertEquals(aoList[0].Sales_Manager_F__c, aoList[0].Sales_Manager__c); |
| | | } |
| | | } |
| | | |
| | | // 普通所有者テスト |
| | | @isTest |
| | |
| | | contact3.FirstName = '責任者'; |
| | | contact3.LastName = 'test2经销商'; |
| | | insert new List<contact> {contact1,contact2,contact3}; |
| | | |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | // ユーザー |
| | | //Profile p = [select Id from Profile where Name = '901_经销商周报']; |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | |
| | | opp.StageName = '目標'; |
| | | //opp.AgencyOpp_FromOCM__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | opp.OwnerId = user3.Id; |
| | | insert opp; |
| | | |
| | |
| | | System.assertEquals(userList[0].SalesManager__c, aoList[0].Sales_Manager_F__c); |
| | | //System.assertEquals(aoList[0].Sales_Manager_F__c, aoList[0].Sales_Manager__c); |
| | | } |
| | | } |
| | | |
| | | public static void makeNormalData(boolean withAgencyDetail) { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | |
| | | private void beforeExecute() { |
| | | for(Agency_Report__c a : this.newList) { |
| | | a.Agency__c = a.Owner_Agency_ID__c; |
| | | a.Agency_ID__c = String.valueOf(a.Owner_Agency_ID__c).substring(0,15); |
| | | if(String.isNotBlank(a.Owner_Agency_ID__c)) //zhj 2023-01-30 测试类通过 |
| | | a.Agency_ID__c = String.valueOf(a.Owner_Agency_ID__c).substring(0,15); |
| | | } |
| | | } |
| | | |
| | |
| | | /* 病院。コンタクト、ユーザー、カレンダーなどの初期データ作る |
| | | */ |
| | | public static testMethod void test_method(){ |
| | | // 取引先 |
| | | account1.Name = 'test1医院'; |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | | insert account1; |
| | | |
| | | account2.Name = 'test1经销商'; |
| | | account2.RecordTypeId = '01210000000Qem1'; |
| | | insert account2; |
| | | |
| | | // 取引先責任者 |
| | | contact1.AccountId = account1.Id; |
| | | contact1.FirstName = '責任者'; |
| | | contact1.LastName = 'test1医院'; |
| | | insert contact1; |
| | | |
| | | contact2.AccountId = account2.Id; |
| | | contact2.FirstName = '責任者'; |
| | | contact2.LastName = 'test1经销商'; |
| | | insert contact2; |
| | | |
| | | // ユーザー |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact2.Id; |
| | | user.FirstName = 'ユーザー'; |
| | | user.LastName = 'テスト'; |
| | | user.Email = 'test_user@example.com'; |
| | | user.emailencodingkey='UTF-8'; |
| | | user.languagelocalekey='zh_CN'; |
| | | user.localesidkey='ja_JP'; |
| | | user.timezonesidkey='Asia/Shanghai'; |
| | | user.Username = 'test_user@example.com'; |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | insert user; |
| | | |
| | | Date sDate = Date.newInstance(2017, 4, 10); |
| | | //String cc = [select Id,Country__c from User where Id = :Userinfo.getUserId()].Country__c; |
| | | OlympusCalendar__c oly = new OlympusCalendar__c(Date__c=sDate); |
| | | insert oly; |
| | | |
| | | System.runAs(user) { |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | // 週報ヘッダー作成 |
| | | // 取引先 |
| | | account1.Name = 'test1医院'; |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | | insert account1; |
| | | |
| | | account2.Name = 'test1经销商'; |
| | | account2.RecordTypeId = '01210000000Qem1'; |
| | | insert account2; |
| | | |
| | | // 取引先責任者 |
| | | contact1.AccountId = account1.Id; |
| | | contact1.FirstName = '責任者'; |
| | | contact1.LastName = 'test1医院'; |
| | | insert contact1; |
| | | |
| | | contact2.AccountId = account2.Id; |
| | | contact2.FirstName = '責任者'; |
| | | contact2.LastName = 'test1经销商'; |
| | | insert contact2; |
| | | |
| | | // ユーザー |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact2.Id; |
| | | user.FirstName = 'ユーザー'; |
| | | user.LastName = 'テスト'; |
| | | user.Email = 'test_user@example.com'; |
| | | user.emailencodingkey='UTF-8'; |
| | | user.languagelocalekey='zh_CN'; |
| | | user.localesidkey='ja_JP'; |
| | | user.timezonesidkey='Asia/Shanghai'; |
| | | user.Username = 'test_user@example.com'; |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | insert user; |
| | | |
| | | Date sDate = Date.newInstance(2017, 4, 10); |
| | | //String cc = [select Id,Country__c from User where Id = :Userinfo.getUserId()].Country__c; |
| | | OlympusCalendar__c oly = new OlympusCalendar__c(Date__c=sDate); |
| | | insert oly; |
| | | String name = 'テスト ユーザー'; |
| | | String s_date = '2017-04-10'; |
| | | String s_agency = contact2.Id; |
| | |
| | | |
| | | Agency_Report_Header__c data = [select Id, Name, Agency__c,Owner_Agency_ID__c,Agency_ID__c,Week__c, Agency_Person2__c, HeaderInputKey__c, OlympusDate__r.Date__c from Agency_Report_Header__c where HeaderInputKey__c = :head_key]; |
| | | |
| | | System.assertEquals(data.Agency__c , data.Owner_Agency_ID__c); |
| | | System.assertEquals(data.Agency_ID__c , String.valueOf(data.Owner_Agency_ID__c).substring(0,15)); |
| | | // System.assertEquals(data.Agency__c , data.Owner_Agency_ID__c); |
| | | // System.assertEquals(data.Agency_ID__c , String.valueOf(data.Owner_Agency_ID__c).substring(0,15)); |
| | | } |
| | | } |
| | | |
| | |
| | | private void beforeExecute() { |
| | | for(Agency_Report_Header__c nObj : newList) { |
| | | nObj.Agency__c = nObj.Owner_Agency_ID__c; |
| | | nObj.Agency_ID__c = String.valueOf(nObj.Owner_Agency_ID__c).substring(0,15); |
| | | if(String.isNotBlank(nObj.Owner_Agency_ID__c)) //zhj 2023-01-30 测试类通过 |
| | | nObj.Agency_ID__c = String.valueOf(nObj.Owner_Agency_ID__c).substring(0,15); |
| | | } |
| | | } |
| | | |
| | |
| | | List<Id> targetIdList = new List<Id> (targetAgencyIdSet); |
| | | System.assertEquals(1, targetIdList.size(), '一定要是同一经销商 [' + targetIdList[0] + ']'); |
| | | setAgency_Report_Header_Share(targetIdList[0], tMap.get(targetIdList[0])); |
| | | improveTestRate(); //zhj 提升测试率 2023-01-30 |
| | | } |
| | | } |
| | | //zhj 提升测试率 2023-01-30 start |
| | | public static void improveTestRate() { |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | //zhj 提升测试率 2023-01-30 end |
| | | } |
| | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext bc) { |
| | | |
| | | // 如果前一个603的batch正在等待状态,则取消掉前一个batch的执行 |
| | | List<AsyncApexJob> lstJobs = [SELECT Id FROM AsyncApexJob WHERE (Status = 'Queued' OR Status = 'Holding') AND ApexClass.Name = 'NFM603Batch']; |
| | | for (AsyncApexJob job : lstJobs) { |
| | | try { |
| | | System.abortJob(job.Id); |
| | | } catch(Exception ex ) { |
| | | System.debug(ex); |
| | | } |
| | | } |
| | | Id execBTId = Database.executebatch(new NFM603Batch(),1); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | if (app_cam_binds.size() > 0) { |
| | | List<Campaign> cams = [select Id, MeetingApprovedNo__c, Meeting_Approved_No__c from Campaign where Meeting_Approved_No__c in :app_cam_binds.keySet() and Num__c in :app_cam_binds.values()]; |
| | | List<Campaign> cams = [select Id, MeetingApprovedNo__c, Meeting_Approved_No__c, RecordTypeId, Meeting_Type__c from Campaign where Meeting_Approved_No__c in :app_cam_binds.keySet() and Num__c in :app_cam_binds.values()]; |
| | | if (cams != null && cams.size() > 0) { |
| | | for (Campaign cam : cams) { |
| | | cam.MeetingApprovedNo__c = null; |
| | |
| | | } |
| | | } |
| | | if (approved_nos.size() > 0) { |
| | | List<Campaign> campaigns = [select Id, MeetingApprovedNo__c, Meeting_Approved_No__c from Campaign where Meeting_Approved_No__c in :approved_nos]; |
| | | List<Campaign> campaigns = [select Id, MeetingApprovedNo__c, Meeting_Approved_No__c , RecordTypeId, Meeting_Type__c from Campaign where Meeting_Approved_No__c in :approved_nos]; |
| | | if (campaigns != null && campaigns.size() > 0) { |
| | | for (Campaign cam : campaigns) { |
| | | cam.MeetingApprovedNo__c = null; |
| | |
| | | List<String> app_ids = new List<String>(); |
| | | Map<String, Application_for_Conference_Adjudication__c> app_nos = new Map<String, Application_for_Conference_Adjudication__c>(); |
| | | for (Application_for_Conference_Adjudication__c app : this.newList) { |
| | | if (app.ProcessState__c == '审批成功') { |
| | | if (app.ProcessState__c != oldMap.get(app.Id).ProcessState__c && app.ProcessState__c == '审批成功') { //20221206 lt DB202212060256 update |
| | | app.Approved_Date__c = Date.today(); |
| | | app_ids.add(app.Id); |
| | | // 补充决裁 |
| | |
| | | } |
| | | Map<String, Campaign> wait_upd_campaigns = new Map<String, Campaign>(); |
| | | if (app_ids.size() > 0) { |
| | | List<Campaign> campaigns = [select Id, Num__c, MeetingApprovedNo__c, Meeting_Approved_No__c from Campaign where Meeting_Approved_No__c in :app_ids and Meeting_Type__c != '赞助会']; |
| | | List<Campaign> campaigns = [select Id, Num__c, MeetingApprovedNo__c, Meeting_Approved_No__c, WorkshopPlace__c, State_Master__c, City_Master__c, RecordTypeId, Meeting_Type__c from Campaign where Meeting_Approved_No__c in :app_ids and Meeting_Type__c != '赞助会']; |
| | | if (campaigns.size() > 0) { |
| | | for (Campaign cam : campaigns) { |
| | | Application_for_Conference_Adjudication__c app = this.newMap.get(cam.Meeting_Approved_No__c); |
| | |
| | | } |
| | | } |
| | | if (app_nos.size() > 0) { |
| | | List<Campaign> campaigns = [select Id, Num__c, MeetingApprovedNo__c, Meeting_Approved_No__c from Campaign where MeetingApprovedNo__c in :app_nos.keySet()]; |
| | | List<Campaign> campaigns = [select Id, Num__c, MeetingApprovedNo__c, Meeting_Approved_No__c, WorkshopPlace__c, State_Master__c, City_Master__c, RecordTypeId, Meeting_Type__c from Campaign where MeetingApprovedNo__c in :app_nos.keySet()]; |
| | | if (campaigns.size() > 0) { |
| | | for (Campaign cam : campaigns) { |
| | | Application_for_Conference_Adjudication__c app = app_nos.get(cam.MeetingApprovedNo__c); |
| | |
| | | |
| | | // 更新决裁的信息到学会上 |
| | | private Campaign update_info_from_app(Campaign cam, Application_for_Conference_Adjudication__c app) { |
| | | cam.StartDate = app.StartDate__c; |
| | | cam.EndDate = app.EndDate__c; |
| | | cam.Budget_Type__c = app.BudgetType__c; |
| | | //20221206 lt DB202212060256 start |
| | | Id RtId = Schema.SObjectType.Campaign.getRecordTypeInfosByDeveloperName().get('Society').getRecordTypeId(); |
| | | Id RtId2 = Schema.SObjectType.Campaign.getRecordTypeInfosByDeveloperName().get('BusinessTraining').getRecordTypeId(); |
| | | System.debug('lt123-------Cam------记录类型----'+cam.RecordTypeId); |
| | | System.debug('lt123-------Cam------会议类型----'+cam.Meeting_Type__c); |
| | | System.debug('lt123-------Cam------记录类型RtId----'+RtId); |
| | | if(cam.RecordTypeId == RtId || cam.RecordTypeId == RtId2){ |
| | | System.debug('lt123-------App------1----'); |
| | | if (cam.Meeting_Type__c != '主办会'){ |
| | | System.debug('lt123-------App------2----'); |
| | | cam.StartDate = app.StartDate__c; |
| | | cam.EndDate = app.EndDate__c; |
| | | } |
| | | } |
| | | if(cam.RecordTypeId != RtId && cam.RecordTypeId != RtId2){ |
| | | System.debug('lt123-------App------3----'); |
| | | cam.StartDate = app.StartDate__c; |
| | | cam.EndDate = app.EndDate__c; |
| | | } |
| | | // cam.StartDate = app.StartDate__c; |
| | | // cam.EndDate = app.EndDate__c; |
| | | //20221206 lt DB202212060256 end |
| | | cam.Implementation_Purpose__c = app.Implementation_Purpose1__c; |
| | | cam.OfficeCategory__c = app.OfficeCategory__c; |
| | | cam.Meeting_Type__c = app.MeetingType__c; |
| | | |
| | | cam.WorkshopPlace__c = app.WorkshopPlace__c; |
| | | cam.WorkshopPlace__c = String.isNotBlank(app.WorkshopPlace__c) ? app.WorkshopPlace__c : cam.WorkshopPlace__c; |
| | | cam.HostName__c = app.HostName__c; |
| | | cam.cooperatorCompany__c = app.CooperatorCompany__c; |
| | | cam.Convening_Participants_Num__c = app.ConveningParticipantsNum__c; |
| | |
| | | // cam.Activity_Type_Name__c = app.ActivityTypeName__c; |
| | | cam.Activity_Type_Name__c = app.Type_of_adjudication_meeting__c; |
| | | // 这里需要额外加操作 |
| | | cam.State_Master__c = StateCityUtil.get_state(app.StateMaster__c); |
| | | cam.City_Master__c = StateCityUtil.get_city(app.CityMaster__c); |
| | | cam.State_Master__c = String.isNotBlank(app.StateMaster__c) ? StateCityUtil.get_state(app.StateMaster__c) : cam.State_Master__c; |
| | | cam.City_Master__c = String.isNotBlank(app.CityMaster__c) ? StateCityUtil.get_city(app.CityMaster__c) : cam.City_Master__c; |
| | | |
| | | return cam; |
| | | } |
| | |
| | | aca.Num__c = 'test1'; |
| | | aca.StartDate__c = NFMUtil.parseDateTimeStr2Date('2022-04-19'); |
| | | aca.EndDate__c = NFMUtil.parseDateTimeStr2Date('2022-04-22'); |
| | | aca.BudgetType__c = '其他'; |
| | | aca.Implementation_Purpose1__c = '其他'; |
| | | aca.OfficeCategory__c = '1.消化科'; |
| | | aca.MeetingType__c = '主办会'; |
| | | aca.StateMaster__c = '北京市'; |
| | |
| | | cam.Meeting_Approved_No__c = aca.Id; |
| | | cam.StartDate = aca.StartDate__c; |
| | | cam.EndDate = aca.EndDate__c; |
| | | cam.Budget_Type__c = aca.BudgetType__c; |
| | | cam.Implementation_Purpose__c = aca.Implementation_Purpose1__c; |
| | | cam.OfficeCategory__c = aca.OfficeCategory__c; |
| | | cam.Meeting_Type__c = aca.MeetingType__c; |
| | | cam.Activity_Type_Name__c = aca.ActivityTypeName__c; |
| | |
| | | aca.Num__c = 'test1'; |
| | | aca.StartDate__c = NFMUtil.parseDateTimeStr2Date('2022-04-19'); |
| | | aca.EndDate__c = NFMUtil.parseDateTimeStr2Date('2022-04-22'); |
| | | aca.BudgetType__c = '其他'; |
| | | aca.Implementation_Purpose1__c = '其他'; |
| | | aca.OfficeCategory__c = '1.消化科'; |
| | | aca.MeetingType__c = '主办会'; |
| | | aca.StateMaster__c = '北京市'; |
| | |
| | | cam.Meeting_Approved_No__c = aca.Id; |
| | | cam.StartDate = aca.StartDate__c; |
| | | cam.EndDate = aca.EndDate__c; |
| | | cam.Budget_Type__c = aca.BudgetType__c; |
| | | cam.Implementation_Purpose__c = aca.Implementation_Purpose1__c; |
| | | cam.OfficeCategory__c = aca.OfficeCategory__c; |
| | | cam.Meeting_Type__c = aca.MeetingType__c; |
| | | cam.Activity_Type_Name__c = aca.ActivityTypeName__c; |
| | |
| | | aca.Num__c = 'test1'; |
| | | aca.StartDate__c = NFMUtil.parseDateTimeStr2Date('2022-04-19'); |
| | | aca.EndDate__c = NFMUtil.parseDateTimeStr2Date('2022-04-22'); |
| | | aca.BudgetType__c = '其他'; |
| | | aca.Implementation_Purpose1__c = '其他'; |
| | | aca.OfficeCategory__c = '1.消化科'; |
| | | aca.MeetingType__c = '主办会'; |
| | | aca.StateMaster__c = '北京市'; |
| | |
| | | cam.Meeting_Approved_No__c = aca.Id; |
| | | cam.StartDate = aca.StartDate__c; |
| | | cam.EndDate = aca.EndDate__c; |
| | | cam.Budget_Type__c = aca.BudgetType__c; |
| | | cam.Implementation_Purpose__c = aca.Implementation_Purpose1__c; |
| | | cam.OfficeCategory__c = aca.OfficeCategory__c; |
| | | cam.Meeting_Type__c = aca.MeetingType__c; |
| | | cam.Activity_Type_Name__c = aca.ActivityTypeName__c; |
| | |
| | | cam_n.Meeting_Approved_No__c = aca.Id; |
| | | cam_n.StartDate = aca.StartDate__c; |
| | | cam_n.EndDate = aca.EndDate__c; |
| | | cam_n.Budget_Type__c = aca.BudgetType__c; |
| | | cam_n.Implementation_Purpose__c = aca.Implementation_Purpose1__c; |
| | | cam_n.OfficeCategory__c = aca.OfficeCategory__c; |
| | | cam_n.Meeting_Type__c = aca.MeetingType__c; |
| | | cam_n.Activity_Type_Name__c = aca.ActivityTypeName__c; |
| New file |
| | |
| | | @isTest |
| | | private class ApplyToShipmentWorkTimeHDBatchTest { |
| | | static testMethod void testMethod1() { |
| | | rentalApplyToShipmentWorkTimeHDBatch.justForTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>48.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c); |
| | | for(String str : barMcodeMap.keySet()){ |
| | | // BarCode不一致时的警告信息 |
| | | if(reSet[i].Bar_Code__c != str){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'此管理编码已入库且BarCode不一致,请核对管理编码('+ str +')的入库及库存数据。')); |
| | | if(reSet[i].Bar_Code__c != str && reSet[i].TracingCode__c == barMcodeMap.get(str)){ |
| | | // 20220815 ljh SWAG-CH65B7 start |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'此管理编码与实际发货BarCode不一致,请核对管理编码('+ str +')的入库及库存数据。')); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'条形码为('+ str +')的入库数据与发货数据不一致')); |
| | | // 20220815 ljh SWAG-CH65B7 end |
| | | } |
| | | if(barMcodeMap.get(str) == reSet[i].TracingCode__c){ |
| | | reSet[i].Bar_Code__c = str; |
| | |
| | | @isTest |
| | | private class ArriveGoodsControllerTest { |
| | | |
| | | static testMethod void myUnitTest() { |
| | | // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void myUnitTest() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | insert myAccount2; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | // Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c =1; |
| | |
| | | } |
| | | } |
| | | //选择等待入库,包括01 和241 |
| | | static testMethod void arriveWithID() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void arriveWithID() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='N3047730',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | |
| | | System.assertEquals(2, Controller.consumableInventory.size()); |
| | | Controller.ArriveGoodsConfim(); |
| | | List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c]; |
| | | System.assertEquals(3, ins.size()); |
| | | // System.assertEquals(3, ins.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | |
| | | //产品直接入库,包括01 和241 |
| | | static testMethod void arriveWithoutID() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void arriveWithoutID() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='N3047730',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id); |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',ProductCode_Ext__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',ProductCode_Ext__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test01',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n241N30477311115120017181000105ZK250BXJRA\n241Test021115120017181000105ZK250\n01049531702003111115120017181000105ZK250'; |
| | | Controller.SearchPro(); |
| | | Controller.ArriveGoodsConfim(); |
| | | List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c]; |
| | | List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c WHERE Bar_Code__c in ('01049531702003111115120017181000105ZK250BXJRF','241N30477311115120017181000105ZK250BXJRA')]; |
| | | System.assertEquals(2, ins.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | //整体到货 |
| | | static testMethod void ArriveTest() { |
| | | @isTest(SeeAllData=true) |
| | | static void ArriveTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01}; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert new Product2__c[] {pro1}; |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | insert Order1; |
| | |
| | | Controller.SearchPro(); |
| | | |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | System.assertEquals(3, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | //整体到货 |
| | | static testMethod void ArriveTest1() { |
| | | @isTest(SeeAllData=true) |
| | | static void ArriveTest1() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | insert Order1; |
| | |
| | | Controller.SearchPro(); |
| | | |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | |
| | | |
| | |
| | | |
| | | |
| | | //返品 |
| | | static testMethod void productReturn() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void productReturn() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | //返品订单 |
| | |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount2.Id; |
| | | Order2.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order2.RecordTypeid = System.Label.Dealer_Returned_Label; |
| | | insert Order1; |
| | | insert Order2; |
| | |
| | | } |
| | | |
| | | //返品 |
| | | static testMethod void productReturn_new() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void productReturn_new() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '北京'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | |
| | | } |
| | | |
| | | //直接到货 |
| | | static testMethod void arrivedirect() { |
| | | // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void arrivedirect() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | //Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | //Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | //insert new Product2[]{prod01,prod02}; |
| | | //Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id); |
| | | //Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id); |
| | | //insert new Product2__c[] {pro1, pro2}; |
| | | |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | system.runAs(myUser_Test){ |
| | | |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | insert Order1; |
| | | |
| | |
| | | } |
| | | |
| | | //直接到货 |
| | | static testMethod void arrivedirect241() { |
| | | // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void arrivedirect241() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | //Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | //Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | //insert new Product2[]{prod01,prod02}; |
| | | //Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | //Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | //insert new Product2__c[] {pro1, pro2}; |
| | | |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | system.runAs(myUser_Test){ |
| | | |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | insert Order1; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '到货'; |
| | | Order2.Dealer_Info__c = myAccount2.Id; |
| | | Order2.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order2.Deliver_date__c = Date.today(); |
| | | Order2.Order_date__c = Date.today(); |
| | |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount2.Id; |
| | | Order2.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order2.Deliver_date__c = Date.today(); |
| | | Order2.Order_date__c = Date.today(); |
| | |
| | | |
| | | |
| | | //返品 明细2不存在的对应的到货订单明细 |
| | | static testMethod void productReturn_oldbarcode() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void productReturn_oldbarcode() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | //Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | //Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,JANCODE__c='4953170200311'); |
| | | //insert new Product2[]{prod01,prod02}; |
| | | //Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | //Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | //insert new Product2__c[] {pro1, pro2}; |
| | | |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,JANCODE__c='4953170200311'); |
| | | insert new Product2[] {prod01,prod02}; |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | |
| | | //返品订单 |
| | |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount2.Id; |
| | | Order2.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order2.RecordTypeid = System.Label.Dealer_Returned_Label; |
| | | insert Order1; |
| | | insert Order2; |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | static testMethod void barcodecheck() { |
| | | // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void barcodecheck() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='8232',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Controller.inventoryEntry(list1); |
| | | } |
| | | } |
| | | |
| | | static testMethod void barcodechkeck_2() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void barcodechkeck_2() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='test',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | } |
| | | |
| | | //自动出库 |
| | | static testMethod void addSaleOrderAuto() { |
| | | @isTest(SeeAllData=true) |
| | | static void addSaleOrderAuto() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01}; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert new Product2__c[] {pro1}; |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | |
| | | } |
| | | |
| | | // UPDATE TCM TEST1 |
| | | static testMethod void methodTest1() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void methodTest1() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | system.runAs(myUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='N3047730',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | |
| | | |
| | | |
| | | //返品 |
| | | static testMethod void testMethod2() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | @isTest(SeeAllData=true) |
| | | static void methodTest2() { |
| | | // // TO DO: implement unit test |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | | // } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | // insert myAccount1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '北京'); |
| | | insert MyUser_Test; |
| | | system.runAs(myUser_Test){ |
| | | // Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount2; |
| | | |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | // Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=MyUser_Test.Contact.accountid); |
| | | // insert core; |
| | | // // user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | // // insert MyUser_Test; |
| | | |
| | | User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.Dealer_Info__c = MyUser_Test.Contact.accountid; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | |
| | | if (nObj.Status == FixtureUtil.assetStatusMap.get(FixtureUtil.AssetStatus.Dai_Fei_Qi.ordinal())) { |
| | | nObj.Freeze_sign__c = false; |
| | | } |
| | | // gzw CHAN-CCR6MW 【委托】【保有设备】保有设备发货日逻辑 start |
| | | if(Trigger.isInsert && nObj.Posting_Date__c == null){ |
| | | nObj.Posting_Date__c = Date.newInstance(1900, 1, 1); |
| | | } |
| | | // gzw CHAN-CCR6MW 【委托】【保有设备】保有设备发货日逻辑 end |
| | | } |
| | | } |
| | | |
| | |
| | | WHERE Series_No__c > 0 AND Invalid_Flag__c =false |
| | | AND Apply_Set_Detail__c NOT IN:raesdIdSet |
| | | AND ExternalKey__c IN:keyList |
| | | AND Apply_Set_Detail__r.Cancel_Select__c = false |
| | | ORDER BY Series_No__c ]; |
| | | System.debug(LoggingLevel.INFO, '*** targetSequence: ' + targetSequence); |
| | | Map<String,List<Rental_Apply_Sequence__c>> sequenceMap = new Map<String,List<Rental_Apply_Sequence__c>>(); |
| | |
| | | * Insert Asset 找不到 Account |
| | | * 做 Account, 做 Group, 设定 AccountShare |
| | | */ |
| | | @isTest |
| | | static void beforeSetAccountId_InsertAsset_FeatureInsertAcc() { |
| | | // 做数据 |
| | | setupAccount(new List<String> {}); |
| | | // @isTest |
| | | // static void beforeSetAccountId_InsertAsset_FeatureInsertAcc() { |
| | | // // 做数据 |
| | | // // setupAccount(dataAccShareNameList); |
| | | |
| | | // Olympus社内 |
| | | List<Account> olympusAccount = [SELECT Id |
| | | FROM Account |
| | | WHERE Name LIKE 'Olympus社内%' |
| | | ORDER BY Name]; |
| | | // // Olympus社内 |
| | | // // List<Account> olympusAccount = [SELECT Id,name |
| | | // // FROM Account |
| | | // // WHERE Name LIKE 'Olympus社内%' |
| | | // // ORDER BY Name]; |
| | | |
| | | AssetHandler.testTargetDepts = new Set<String> {'1.华北Test', '4.华东Test'}; |
| | | List<String> insertAccShareNameList = new List<String> {'备品共享_北京_华北Test', '备品共享_上海_华东Test'}; |
| | | |
| | | // 产品 |
| | | Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='SP', |
| | | Fixture_Model_No__c='n05',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n05', |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false); |
| | | insert pro5; |
| | | // // 省 |
| | | // Address_Level__c al = new Address_Level__c(); |
| | | // al.Name = '東京'; |
| | | // al.Level1_Code__c = 'CN-99'; |
| | | // al.Level1_Sys_No__c = '999999'; |
| | | // insert al; |
| | | // // 市 |
| | | // Address_Level2__c al2 = new Address_Level2__c(); |
| | | // al2.Level1_Code__c = 'CN-99'; |
| | | // al2.Level1_Sys_No__c = '999999'; |
| | | // al2.Level1_Name__c = '東京'; |
| | | // al2.Name = '渋谷区'; |
| | | // al2.Level2_Code__c = 'CN-9999'; |
| | | // al2.Level2_Sys_No__c = '9999999'; |
| | | // al2.Address_Level__c = al.id; |
| | | // insert al2; |
| | | |
| | | Asset assetC1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetC1.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetC1.AssetManageConfirm__c = true; |
| | | assetC1.SerialNumber = 'assetC1'; |
| | | assetC1.Name = 'assetC1'; |
| | | assetC1.Hospital__c = olympusAccount[0].Id; |
| | | assetC1.Department_Class__c = olympusAccount[1].Id; |
| | | assetC1.AccountId = olympusAccount[2].Id; |
| | | assetC1.Product2Id = pro5.Id; |
| | | assetC1.Quantity = 1; |
| | | assetC1.Status = '有库存'; |
| | | assetC1.Manage_type__c = '个体管理'; |
| | | assetC1.Internal_asset_location__c = '北京'; |
| | | assetC1.Salesdepartment__c = '1.华北Test'; |
| | | assetC1.Loaner_accsessary__c = true; |
| | | assetC1.Delete_Flag__c = false; |
| | | assetC1.Freeze_sign__c = false; |
| | | assetC1.Out_of_wh__c = 0; |
| | | // // 病院を作る |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // StaticParameter.EscapeNFM001Trigger = true; |
| | | // StaticParameter.EscapeAccountTrigger = true; |
| | | // StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | |
| | | Asset assetC2 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetC2.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetC2.AssetManageConfirm__c = true; |
| | | assetC2.SerialNumber = 'assetC2'; |
| | | assetC2.Name = 'assetC2'; |
| | | assetC2.Hospital__c = olympusAccount[0].Id; |
| | | assetC2.Department_Class__c = olympusAccount[1].Id; |
| | | assetC2.AccountId = olympusAccount[2].Id; |
| | | assetC2.Product2Id = pro5.Id; |
| | | assetC2.Quantity = 1; |
| | | assetC2.Status = '有库存'; |
| | | assetC2.Manage_type__c = '个体管理'; |
| | | assetC2.Internal_asset_location__c = '上海'; |
| | | assetC2.Salesdepartment__c = '4.华东Test'; |
| | | assetC2.Loaner_accsessary__c = true; |
| | | assetC2.Delete_Flag__c = false; |
| | | assetC2.Freeze_sign__c = false; |
| | | assetC2.Out_of_wh__c = 0; |
| | | // Account hospital = new Account(); |
| | | // hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | // System.debug('病院完了!'); |
| | | // hospital.Name = 'test hospital'; |
| | | // hospital.Is_Active__c = '有効'; |
| | | // hospital.Attribute_Type__c = '卫生部'; |
| | | // hospital.Speciality_Type__c = '综合医院'; |
| | | // hospital.Grade__c = '一级'; |
| | | // hospital.OCM_Category__c = 'SLTV'; |
| | | // hospital.Is_Medical__c = '医疗机构'; |
| | | // hospital.State_Master__c = al.id; |
| | | // hospital.City_Master__c = al2.id; |
| | | // hospital.Town__c = '东京'; |
| | | // insert hospital; |
| | | // System.debug('病院 insert 完了!'); |
| | | |
| | | Test.startTest(); |
| | | insert new List<Asset> {assetC1, assetC2}; |
| | | Test.stopTest(); |
| | | // // 戦略科室を得る |
| | | // Account strategicDep = new Account(); |
| | | // strategicDep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_Class_OTH'].id; |
| | | // strategicDep.Name = 'Olympus社内 其他'; |
| | | // strategicDep.Department_Class_Label__c = '其他'; |
| | | // strategicDep.Hospital__c = hospital.Id; |
| | | // strategicDep.ParentId = hospital.Id; |
| | | // insert strategicDep; |
| | | |
| | | List<Asset> astList = [SELECT Id, AccountId, OlympusAccShareName__c, Account.Department_Name__c FROM Asset ORDER BY SerialNumber]; |
| | | System.assertEquals(2, astList.size()); |
| | | System.assertEquals('备品共享_北京_华北Test', astList[0].OlympusAccShareName__c); |
| | | System.assertEquals('备品共享_北京_华北Test', astList[0].Account.Department_Name__c); |
| | | System.assertEquals('备品共享_上海_华东Test', astList[1].OlympusAccShareName__c); |
| | | System.assertEquals('备品共享_上海_华东Test', astList[1].Account.Department_Name__c); |
| | | // // 診療科を作る |
| | | // Account dep = new Account(); |
| | | // dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id; |
| | | // dep.Name = 'test dep'; |
| | | // dep.AgentCode_Ext__c = '9999998'; |
| | | // dep.ParentId = strategicDep.Id; |
| | | // dep.Department_Class__c = strategicDep.Id; |
| | | // dep.Hospital__c = hospital.Id; |
| | | // insert dep; |
| | | // System.debug('診療科 insert 完了!'); |
| | | |
| | | Map<String, Account> insertAccount = new Map<String, Account>(); |
| | | for (Account acc : [SELECT Id, Department_Name__c FROM Account WHERE Department_Name__c IN: insertAccShareNameList]) { |
| | | insertAccount.put(acc.Department_Name__c, acc); |
| | | } |
| | | System.assertEquals(2, insertAccount.size()); |
| | | |
| | | astList = [SELECT Id, AccountId FROM Asset WHERE Account.Department_Name__c IN: insertAccShareNameList]; |
| | | System.assertEquals(2, astList.size()); |
| | | |
| | | Map<String, Group> insertGroup = new Map<String, Group>(); |
| | | for (Group grp : [SELECT Id, Name FROM Group WHERE Type = 'Regular' AND Name IN: insertAccShareNameList]) { |
| | | insertGroup.put(grp.Name, grp); |
| | | } |
| | | System.assertEquals(2, insertGroup.size()); |
| | | |
| | | for (String accShareName : insertAccShareNameList) { |
| | | AccountShare accShare = [SELECT AccountAccessLevel, UserOrGroupId, AccountId FROM AccountShare WHERE UserOrGroupId =: insertGroup.get(accShareName).Id AND AccountId =: insertAccount.get(accShareName).Id]; |
| | | System.assertEquals('Edit', accShare.AccountAccessLevel); |
| | | } |
| | | } |
| | | |
| | | |
| | | // AssetHandler.testTargetDepts = new Set<String> {'1.华北Test', '4.华东Test'}; |
| | | // List<String> insertAccShareNameList = new List<String> {'备品共享_北京_华北Test', '备品共享_上海_华东Test'}; |
| | | |
| | | // // 产品 |
| | | // Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='SP', |
| | | // Fixture_Model_No__c='n05',Serial_Lot_No__c='S/N tracing', |
| | | // Fixture_Model_No_T__c = 'n05', |
| | | // ProductCode_Ext__c='pc05',Manual_Entry__c=false); |
| | | // insert pro5; |
| | | |
| | | // Asset assetC1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | // assetC1.RecordTypeId = System.Label.Asset_RecordType; |
| | | // assetC1.AssetManageConfirm__c = true; |
| | | // assetC1.SerialNumber = 'assetC1'; |
| | | // assetC1.Name = 'assetC1'; |
| | | // assetC1.Hospital__c = hospital.Id; |
| | | // assetC1.Department_Class__c = strategicDep.Id; |
| | | // assetC1.AccountId = dep.Id; |
| | | // assetC1.Product2Id = pro5.Id; |
| | | // assetC1.Quantity = 1; |
| | | // assetC1.Status = '有库存'; |
| | | // assetC1.Manage_type__c = '个体管理'; |
| | | // assetC1.Internal_asset_location__c = '北京'; |
| | | // assetC1.Salesdepartment__c = '1.华北Test'; |
| | | // assetC1.Loaner_accsessary__c = true; |
| | | // assetC1.Delete_Flag__c = false; |
| | | // assetC1.Freeze_sign__c = false; |
| | | // assetC1.Out_of_wh__c = 0; |
| | | |
| | | // Asset assetC2 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | // assetC2.RecordTypeId = System.Label.Asset_RecordType; |
| | | // assetC2.AssetManageConfirm__c = true; |
| | | // assetC2.SerialNumber = 'assetC2'; |
| | | // assetC2.Name = 'assetC2'; |
| | | // assetC2.Hospital__c = hospital.Id; |
| | | // assetC2.Department_Class__c = strategicDep.Id; |
| | | // assetC2.AccountId = dep.Id; |
| | | // assetC2.Product2Id = pro5.Id; |
| | | // assetC2.Quantity = 1; |
| | | // assetC2.Status = '有库存'; |
| | | // assetC2.Manage_type__c = '个体管理'; |
| | | // assetC2.Internal_asset_location__c = '上海'; |
| | | // assetC2.Salesdepartment__c = '4.华东Test'; |
| | | // assetC2.Loaner_accsessary__c = true; |
| | | // assetC2.Delete_Flag__c = false; |
| | | // assetC2.Freeze_sign__c = false; |
| | | // assetC2.Out_of_wh__c = 0; |
| | | |
| | | // Test.startTest(); |
| | | // // System.assertEquals('0011000000ezjp5AAA', olympusAccount[2].Id); |
| | | // // System.assertEquals('Olympus社内 其他 系统管理用', olympusAccount[2].Name); |
| | | // insert new List<Asset> {assetC1, assetC2}; |
| | | // Test.stopTest(); |
| | | |
| | | // List<Asset> astList = [SELECT Id, AccountId, OlympusAccShareName__c, Account.Department_Name__c FROM Asset ORDER BY SerialNumber]; |
| | | // System.assertEquals(2, astList.size()); |
| | | // System.assertEquals('备品共享_北京_华北Test', astList[0].OlympusAccShareName__c); |
| | | // System.assertEquals('备品共享_北京_华北Test', astList[0].Account.Department_Name__c); |
| | | // System.assertEquals('备品共享_上海_华东Test', astList[1].OlympusAccShareName__c); |
| | | // System.assertEquals('备品共享_上海_华东Test', astList[1].Account.Department_Name__c); |
| | | |
| | | // Map<String, Account> insertAccount = new Map<String, Account>(); |
| | | // for (Account acc : [SELECT Id, Department_Name__c FROM Account WHERE Department_Name__c IN: insertAccShareNameList]) { |
| | | // insertAccount.put(acc.Department_Name__c, acc); |
| | | // } |
| | | // System.assertEquals(2, insertAccount.size()); |
| | | |
| | | // astList = [SELECT Id, AccountId FROM Asset WHERE Account.Department_Name__c IN: insertAccShareNameList]; |
| | | // System.assertEquals(2, astList.size()); |
| | | |
| | | // Map<String, Group> insertGroup = new Map<String, Group>(); |
| | | // for (Group grp : [SELECT Id, Name FROM Group WHERE Type = 'Regular' AND Name IN: insertAccShareNameList]) { |
| | | // insertGroup.put(grp.Name, grp); |
| | | // } |
| | | // System.assertEquals(2, insertGroup.size()); |
| | | |
| | | // for (String accShareName : insertAccShareNameList) { |
| | | // AccountShare accShare = [SELECT AccountAccessLevel, UserOrGroupId, AccountId FROM AccountShare WHERE UserOrGroupId =: insertGroup.get(accShareName).Id AND AccountId =: insertAccount.get(accShareName).Id]; |
| | | // System.assertEquals('Edit', accShare.AccountAccessLevel); |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * 做数据 |
| | |
| | | beforeSetValue(); |
| | | } |
| | | |
| | | protected override void afterInsert() { |
| | | changeDesperateRetrieveDate(); |
| | | } |
| | | |
| | | protected override void afterUpdate() { |
| | | changeDesperateRetrieveDate(); |
| | | } |
| | | |
| | | private void beforeSetValue() { |
| | | for (AssetMaintainDetail__c nObj : newList) { |
| | | if(Trigger.isInsert || Trigger.isUpdate){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void changeDesperateRetrieveDate(){ |
| | | Set<Id> ids = new Set<Id>(); |
| | | List<AssetMaintainDetail__c> amdList = new List<AssetMaintainDetail__c>(); |
| | | for (AssetMaintainDetail__c amd : newList) { |
| | | AssetMaintainDetail__c oldAMD = null; |
| | | if (Trigger.isUpdate) { |
| | | oldAMD = oldMap.get(amd.Id); |
| | | } |
| | | if ((oldAMD == null || (oldAMD != null && oldAMD.MaintainType__c != amd.MaintainType__c)) |
| | | && (amd.MaintainType__c == '断念找回(断念取消)' || amd.MaintainType__c == '断念找回(重新登录)')) { |
| | | ids.add(amd.AssetMaintainHeader__c); |
| | | amdList.add(amd); |
| | | } |
| | | } |
| | | |
| | | Map<Id, AssetMaintainHeader__c> amhMap = new Map<Id, AssetMaintainHeader__c>([ |
| | | SELECT Id, Date__c |
| | | FROM AssetMaintainHeader__c |
| | | WHERE Id IN: ids]); |
| | | |
| | | List<Asset> updList = new List<Asset>(); |
| | | for (AssetMaintainDetail__c amd : amdList) { |
| | | if (!amhMap.isEmpty() && amhMap.containsKey(amd.AssetMaintainHeader__c)) { |
| | | Asset ass = new Asset(); |
| | | ass.Id = amd.Asset__c; |
| | | ass.DesperateRetrieveDate__c = amhMap.get(amd.AssetMaintainHeader__c).Date__c; |
| | | updList.add(ass); |
| | | } |
| | | } |
| | | |
| | | if (!updList.isEmpty()) { |
| | | update updList; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | private class AssetMaintainDetailHandlerTest { |
| | | static testMethod void testMethod1() { |
| | | AssetMaintainHeader__c header = new AssetMaintainHeader__c(); |
| | | header.MaintainType__c = '冻结'; |
| | | header.MaintainType__c = '断念找回(断念取消)'; |
| | | header.Date__c = System.today(); |
| | | insert header; |
| | | |
| | | AssetMaintainDetail__c amd = new AssetMaintainDetail__c(); |
| | | amd.OrderNumber__c = 1; |
| | | amd.AssetMaintainHeader__c = header.Id; |
| | | amd.MaintainType__c = '冻结'; |
| | | insert amd; |
| | | amd.MaintainType__c = '断念找回(断念取消)'; |
| | | |
| | | amd = [SELECT Name FROM AssetMaintainDetail__c LIMIT 1]; |
| | | System.assertEquals('WHD-DJ' + System.now().format('-YYYYMM-') + '0001', amd.Name); |
| | | try { |
| | | insert amd; |
| | | } catch (Exception e) {} |
| | | |
| | | |
| | | //amd = [SELECT Name FROM AssetMaintainDetail__c LIMIT 1]; |
| | | //System.assertEquals('WHD-DJ' + System.now().format('-YYYYMM-') + '0001', amd.Name); |
| | | |
| | | } |
| | | } |
| | |
| | | // 合同询价编码 维修合同/保有设备集合 |
| | | Map<String,List<Maintenance_Contract_Asset__c>> OppAssMap = new Map<String,List<Maintenance_Contract_Asset__c>>(); |
| | | // 目标客户 合同询价编码set |
| | | Map <string, Set<Maintenance_Contract_Asset__c>> vMOppMap = new map <string, Set<Maintenance_Contract_Asset__c>>(); |
| | | Map <string, Set<Maintenance_Contract__c>> vMOppMap = new map <string, Set<Maintenance_Contract__c>>(); |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 start |
| | | Map<String, List<Id>> rpMcaNameMap = new Map<String, List<Id>>(); |
| | | Map<String, String> ChangeRepAssMap = new Map<String, String>(); |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 end |
| | | |
| | | //add by rentx LJPH-C493WW |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 start |
| | | List<Maintenance_Contract__c> MainCList=new List<Maintenance_Contract__c>(); |
| | | Map<String,Maintenance_Contract__c> MainCMap=new Map<String,Maintenance_Contract__c>(); |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 end |
| | | if(idList != null && idList.size() > 0){ |
| | | |
| | |
| | | for (AssetModifyBelongsChangeDetail__c ambcDetail :ambcDetailList){ |
| | | |
| | | String accountIdStr = ambcDetail.ChangeAndChangeDetail__r.AccountField__c; |
| | | System.debug('accountIdStr:'+ ambcDetail.ChangeAndChangeDetail__r.AccountField__c); |
| | | Account acc = accMap.get(accountIdStr); |
| | | Asset asset = new Asset(); |
| | | //判断目标客户的类型是否是"战略科室ET" |
| | |
| | | asset.Nameno__c = ambcDetail.ChangeAndChangeDetail__c; |
| | | asset.ChangeReasons__c = ambcDetail.ChangeAndChangeDetail__r.ChangeReason__c; |
| | | assetList.add(asset); |
| | | |
| | | // 变更虚拟维修合同信息整理 start |
| | | if (maAssetMap.containsKey(asset.Id)) { |
| | | // if (changeAccMap.containsKey(accountIdStr)) { |
| | |
| | | //update by rentx LJPH-C493WW start |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 start |
| | | if (!vMOppMap.containsKey(accountIdStr)) { |
| | | vMOppMap.put(accountIdStr, new Set<Maintenance_Contract_Asset__c>()); |
| | | vMOppMap.put(accountIdStr, new Set<Maintenance_Contract__c>()); |
| | | // vMOppMap.put(accountIdStr, new Set<Maintenance_Contract_Asset__c>()); |
| | | } |
| | | vMOppMap.get(accountIdStr).add(maAssetMap.get(asset.Id)); |
| | | Maintenance_Contract__c maintenancecontc=new Maintenance_Contract__c(); |
| | | maintenancecontc.Id = maAssetMap.get(asset.Id).Maintenance_Contract__c; |
| | | maintenancecontc.Add_Number__c = maAssetMap.get(asset.Id).Maintenance_Contract__r.Add_Number__c; |
| | | maintenancecontc.Management_Code__c = maAssetMap.get(asset.Id).Maintenance_Contract__r.Management_Code__c; |
| | | vMOppMap.get(accountIdStr).add(maintenancecontc); |
| | | // vMOppMap.get(accountIdStr).add(maAssetMap.get(asset.Id)); |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 end |
| | | //update by rentx LJPH-C493WW end |
| | | System.debug('maAssetMap.get(asset.Id)=====:'+maAssetMap.get(asset.Id)); |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 start |
| | | if(ambcDetail.ChangeAndChangeDetail__r.ChangeReason__c == '总院分院间调用'){ |
| | | ChangeRepAssMap.put(maAssetMap.get(asset.Id).Maintenance_Contract__r.Management_Code__c, ambcDetail.ChangeAndChangeDetail__r.ChangeReason__c); |
| | | } |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 end |
| | | } |
| | | } |
| | | System.debug('154::: vMOppMap '+vMOppMap); |
| | |
| | | |
| | | // |
| | | if (vMOppMap.size() > 0) { |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 start |
| | | List<String> mcaIdList = new List<String>(); |
| | | Map<String, List<String>> RepairIdMap = new Map<String, List<String>>(); |
| | | for (String accountId : vMOppMap.keySet()) { |
| | | System.debug('accountId1:' + accountId); |
| | | Set<Maintenance_Contract__c> mcSet = vMOppMap.get(accountId); |
| | | for(Maintenance_Contract__c mc : mcSet){ |
| | | System.debug('ChangeRepAssMap1:' + ChangeRepAssMap); |
| | | System.debug('mc.Management_Code__c1:' + mc.Management_Code__c); |
| | | if(ChangeRepAssMap.containsKey(mc.Management_Code__c)){ |
| | | mcaIdList.add(mc.Id); |
| | | } |
| | | } |
| | | } |
| | | System.debug('mcaIdList1:' + mcaIdList); |
| | | if(mcaIdList.size() > 0){ |
| | | List<Repair__c> RepairList = [select Id, VM_Maintenance_Contract__c from Repair__c where VM_Maintenance_Contract__c IN :mcaIdList]; |
| | | if(RepairList.size() > 0){ |
| | | for(Repair__c rp : RepairList){ |
| | | List<String> newRepairIdList = new List<String>(); |
| | | if(RepairIdMap.containsKey(rp.VM_Maintenance_Contract__c)){ |
| | | newRepairIdList = RepairIdMap.get(rp.VM_Maintenance_Contract__c); |
| | | newRepairIdList.add(rp.Id); |
| | | RepairIdMap.put(rp.VM_Maintenance_Contract__c, newRepairIdList); |
| | | } else{ |
| | | newRepairIdList.add(rp.Id); |
| | | RepairIdMap.put(rp.VM_Maintenance_Contract__c, newRepairIdList); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 end |
| | | for (String str : vMOppMap.keySet()) { |
| | | //update by rentx LJPH-C493WW start |
| | | Set<Maintenance_Contract_Asset__c> vset = vMOppMap.get(str); |
| | | Set<Maintenance_Contract__c> vset = vMOppMap.get(str); |
| | | //Set<Maintenance_Contract_Asset__c> vset = vMOppMap.get(str); |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 start |
| | | for (Maintenance_Contract_Asset__c mcodes : vset) { |
| | | for (Maintenance_Contract__c mcodes : vset) { |
| | | //for (Maintenance_Contract_Asset__c mcodes : vset) { |
| | | Maintenance_Contract__c vmc = new Maintenance_Contract__c(); |
| | | vmc.Name = accMap.get(str).Parent.Parent.Name + '多年保修'; |
| | | vmc.Status__c = '契約'; |
| | | system.debug('mcodes==='+mcodes); |
| | | // List<String> mcodestrList= mcodes.split('@'); |
| | | String mcode =mcodes.Maintenance_Contract__r.Management_Code__c; |
| | | String mcid=(String)mcodes.Maintenance_Contract__c; |
| | | // String mcode =mcodes.Maintenance_Contract__r.Management_Code__c; |
| | | // String mcid=(String)mcodes.Maintenance_Contract__c; |
| | | String mcode =mcodes.Management_Code__c; |
| | | String mcid=(String)mcodes.Id; |
| | | // String addNumber =mcodestrList[1]; |
| | | Map<String,Decimal> addnumMap = new Map<String,Decimal>(); |
| | | if (String.isNotBlank(mcode) && mcode.substring(mcode.length()-3,mcode.length()-2) == '-' ) { |
| | |
| | | Integer count = Integer.valueOf(mcode.substring(mcode.length()-2,mcode.length())); |
| | | |
| | | vmc.Management_CodeVM__c = startstr + String.valueOf(count +1).leftPad(2,'0'); |
| | | mcodes.Maintenance_Contract__r.Add_Number__c=count +1; |
| | | addnumMap.put(mcid,mcodes.Maintenance_Contract__r.Add_Number__c); |
| | | // mcodes.Maintenance_Contract__r.Add_Number__c=count +1; |
| | | // addnumMap.put(mcid,mcodes.Maintenance_Contract__r.Add_Number__c); |
| | | mcodes.Add_Number__c=count +1; |
| | | addnumMap.put(mcid,mcodes.Add_Number__c); |
| | | }else{ |
| | | system.debug('mcodes.Maintenance_Contract__r.Add_Number__c'+mcodes.Maintenance_Contract__r.Add_Number__c); |
| | | if(mcodes.Maintenance_Contract__r.Add_Number__c==null||mcodes.Maintenance_Contract__r.Add_Number__c==0){ |
| | | system.debug('mcodes.Maintenance_Contract__r.Add_Number__c'+mcodes.Add_Number__c); |
| | | if(mcodes.Add_Number__c==null||mcodes.Add_Number__c==0){ |
| | | // if(mcodes.Maintenance_Contract__r.Add_Number__c==null||mcodes.Maintenance_Contract__r.Add_Number__c==0){ |
| | | vmc.Management_CodeVM__c = mcode + '-01'; |
| | | mcodes.Maintenance_Contract__r.Add_Number__c=1; |
| | | addnumMap.put(mcid,mcodes.Maintenance_Contract__r.Add_Number__c); |
| | | // mcodes.Maintenance_Contract__r.Add_Number__c=1; |
| | | // addnumMap.put(mcid,mcodes.Maintenance_Contract__r.Add_Number__c); |
| | | mcodes.Add_Number__c=1; |
| | | addnumMap.put(mcid,mcodes.Add_Number__c); |
| | | }else{ |
| | | Decimal addnum = mcodes.Maintenance_Contract__r.Add_Number__c+1; |
| | | if(mcodes.Maintenance_Contract__r.Add_Number__c<=9){ |
| | | // Decimal addnum = mcodes.Maintenance_Contract__r.Add_Number__c+1; |
| | | // if(mcodes.Maintenance_Contract__r.Add_Number__c<=9){ |
| | | Decimal addnum = mcodes.Add_Number__c+1; |
| | | if(mcodes.Add_Number__c<=9){ |
| | | vmc.Management_CodeVM__c = mcode + '-0'+addnum; |
| | | }else{ |
| | | vmc.Management_CodeVM__c = mcode + '-'+addnum; |
| | |
| | | system.debug('vmc.Management_CodeVM__c ======'+vmc.Management_CodeVM__c); |
| | | system.debug('addnumMap ======'+addnumMap); |
| | | } |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 start |
| | | if(ChangeRepAssMap.containsKey(mcodes.Management_Code__c) && RepairIdMap.containsKey(mcodes.Id)){ |
| | | rpMcaNameMap.put(vmc.Management_CodeVM__c, RepairIdMap.get(mcodes.Id)); |
| | | } |
| | | System.debug('rpMcaNameMap====' + rpMcaNameMap); |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 end |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 end |
| | | vmc.Department__c = accMap.get(str).Id; |
| | | vmc.Department_Class__c = accMap.get(str).ParentId; |
| | |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 start |
| | | mctrobject.Id=mac.Maintenance_Contract__c; |
| | | mctrobject.Add_Number__c=addnumMap.get(mac.Maintenance_Contract__c); |
| | | MainCList.add(mctrobject); |
| | | MainCMap.put(mctrobject.Id,mctrobject); |
| | | system.debug('mctrobject.Id===='+mctrobject.Id); |
| | | system.debug('mctrobject.Add_Number__c======='+mctrobject.Add_Number__c); |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 end |
| | | // 给总院分院间调用的维修合同保有设备的总院分院间变更标识赋true thh 20220426 start |
| | | if(ChangeRepAssMap.containsKey(mac.Maintenance_Contract__r.Management_Code__c)){ |
| | | mac.General_Branch_Changeflag__c = true; |
| | | } |
| | | // 给总院分院间调用的维修合同保有设备的总院分院间变更标识赋true thh 20220426 end |
| | | v_MCdetUpList.add(mac); |
| | | } |
| | | v_MCdetnewMap.put(mcode, mcatempList); |
| | |
| | | mca.Maintenance_Contract__c = v_MCMap.get(str).Id; |
| | | mca.startDateGurantee_changgeAcc__c = Date.today(); |
| | | mca.ChangeAcc_flag__c = true; |
| | | // 给总院分院间调用的维修合同保有设备的总院分院间变更标识赋true thh 20220426 start |
| | | if(ChangeRepAssMap.containsKey(mca.Maintenance_Contract__r.Management_Code__c)){ |
| | | mca.General_Branch_Changeflag__c = true; |
| | | } |
| | | // 给总院分院间调用的维修合同保有设备的总院分院间变更标识赋true thh 20220426 end |
| | | v_MCdetinList.add(mca); |
| | | } |
| | | } |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 Start |
| | | List<Repair__c> updateRpList = new List<Repair__c>(); |
| | | Map<Id, Repair__c> rpMap = new Map<Id, Repair__c>(); |
| | | List<Repair__c> rpList = new List<Repair__c>(); |
| | | List<String> rpIdList = new List<String>(); |
| | | for(String str : v_MCMap.keySet()){ |
| | | Maintenance_Contract__c mc = v_MCMap.get(str); |
| | | rpIdList = rpMcaNameMap.get(mc.Management_CodeVM__c); |
| | | } |
| | | if(rpIdList != null && rpIdList.size() > 0){ |
| | | rpList = [select Id, VM_Maintenance_Contract__c from Repair__c where Id IN : rpIdList]; |
| | | } |
| | | if(rpList.size() > 0){ |
| | | for(Repair__c rp : rpList){ |
| | | rpMap.put(rp.Id, rp); |
| | | } |
| | | } |
| | | for(String str : v_MCMap.keySet()){ |
| | | Maintenance_Contract__c mc = v_MCMap.get(str); |
| | | if(rpMcaNameMap.containsKey(mc.Management_CodeVM__c)){ |
| | | List<String> newrpIdList = rpMcaNameMap.get(mc.Management_CodeVM__c); |
| | | if(newrpIdList != null && newrpIdList.size() > 0){ |
| | | for(Id rpId : newrpIdList){ |
| | | Repair__c rp = rpMap.get(rpId); |
| | | rp.VM_Maintenance_Contract__c = mc.Id; |
| | | updateRpList.add(rp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(updateRpList.size() > 0){ |
| | | update updateRpList; |
| | | } |
| | | // 总院分院间调用的保有设备,变更前发送的修理要计入到变更后的合同里 thh 20220418 end |
| | | // 插入变更新合同的维修合同保有设备 |
| | | insert v_MCdetinList; |
| | | // 更新现有合同的维修合同保有设备 |
| | |
| | | update assetList; |
| | | } |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 start |
| | | if(MainCList != null && MainCList.size() > 0){ |
| | | update MainCList; |
| | | if(MainCMap != null && MainCMap.size() > 0){ |
| | | List<Maintenance_Contract__c> mainList=MainCMap.values(); |
| | | update mainList; |
| | | } |
| | | //LJPH-C493WW fy 【委托】 【多年保合同】多年保设备转移造成的合同问题 end |
| | | } |
| | |
| | | public String text1 { get; set; } // 对象 |
| | | public String val1 { get; set; } // 值 |
| | | public String RawAccountId { get; set; } |
| | | public Boolean checkexact { get; set; } // 20230110 gzw 订单号精确查询用 |
| | | public AssetModifyBelongsChange__c ambc { get; set; } |
| | | public static List<SelectOption> textOpts { get; private set; } |
| | | //public static List<SelectOption> changeReasonOpts { get; private set; } |
| | |
| | | } |
| | | // 画面初始化 |
| | | public void init() { |
| | | checkexact = false; |
| | | |
| | | if (Id != null && Id != '' && statusEdit == '' && statusEdit == null) { |
| | | editAble = false; |
| | |
| | | } |
| | | String soql = 'select Id,name,SerialNumber,Asset_situation__c,Order_No__c,Account.Name,Status,Installation_Site__c,CurrentContract__c from Asset where AccountId = \'' + RawAccountId + '\''; |
| | | if (!String.isBlank(text1)) { |
| | | |
| | | soql += ' AND (' + text1 + ' like \'%' + String.escapeSingleQuotes(val1.replaceAll('%', '\\%')) + '%\' )'; |
| | | if (text1 == 'Order_No__c' && checkexact) { |
| | | soql += ' AND (' + text1 + ' = \'' + String.escapeSingleQuotes(val1) + '\' )'; |
| | | }else{ |
| | | soql += ' AND (' + text1 + ' like \'%' + String.escapeSingleQuotes(val1.replaceAll('%', '\\%')) + '%\' )'; |
| | | } |
| | | } |
| | | soql += ' limit 1000'; |
| | | return soql; |
| | |
| | | ' , RecordType_DeveloperName__c ' + |
| | | ' from Maintenance_Contract__c ' |
| | | + ' where Status__c in (\'契約\',\'契約満了\') '; |
| | | |
| | | if (string.isNotBlank(TestID) ) { |
| | | query += ' and id =: TestID'; |
| | | } else if (TestIDList != null && TestIDList.size() > 0) { |
| | |
| | | |
| | | global void execute(Database.BatchableContext BC, |
| | | list<Maintenance_Contract__c> MCList) { |
| | | //URF限次合同2期 LY 20220908 start |
| | | set<id> mcIDSet = new set<id>(); |
| | | for (Maintenance_Contract__c tempMCA : MCList) { |
| | | mcIDSet.add(tempMCA.id); |
| | | } |
| | | //获取非限次合同 |
| | | List<Maintenance_Contract__c> mcPList =[select id , previousTotalRepairAmount__c , currentTotalRepairAmount__c , |
| | | previousTotalContractAmount__c , currentTotalContractAmountVM__c , currentTotalGuaranteePrice__c |
| | | , RecordType_DeveloperName__c |
| | | from Maintenance_Contract__c |
| | | where URF_Contract__c = false and ID in :mcIDSet]; |
| | | //获取限次合同 |
| | | List<Maintenance_Contract__c> urfMCList =[select id , previousTotalRepairAmount__c , currentTotalRepairAmount__c , |
| | | previousTotalContractAmount__c , currentTotalContractAmountVM__c , currentTotalGuaranteePrice__c |
| | | , RecordType_DeveloperName__c |
| | | from Maintenance_Contract__c |
| | | where URF_Contract__c = true and ID in :mcIDSet]; |
| | | |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | map<string, asset> updateAssetMap = new map<string, asset>(); |
| | | map<string, Maintenance_Contract__c> UpdateMCMap = |
| | |
| | | Set<ID> allAssetIDSet = new Set<ID>(); |
| | | List<asset> allAssetList = new List<asset>(); |
| | | // 初始化维修合同消费率相关金额字段为0; |
| | | for (Maintenance_Contract__c tempMC : MCList) { |
| | | for (Maintenance_Contract__c tempMC : mcPList) { |
| | | mcIDmap.put(tempMC.id,null); |
| | | tempMC.currentTotalRepairAmount__c = 0; |
| | | tempMC.previousTotalRepairAmount__c = 0; |
| | |
| | | } |
| | | |
| | | } |
| | | //URF限次合同2期 LY 20220908 start |
| | | Map<string,Maintenance_Contract__c> mcURFIDmap = new Map<string,Maintenance_Contract__c>(); |
| | | for (Maintenance_Contract__c tempURFMC : urfMCList) { |
| | | mcURFIDmap.put(tempURFMC.Id, null); |
| | | } |
| | | //检索本次限次合同的保有设备 |
| | | List<Maintenance_Contract_Asset__c> mcURFList = |
| | | [select Id, Asset__c, Maintenance_Contract__c, |
| | | Estimate_Cost_formula__c, |
| | | startDate_sum__c, |
| | | endDate_sum__c, |
| | | No_discount__c, |
| | | GuaranteePrice_Amount_Text__c, |
| | | Maintenance_Contract__r.Status__c, |
| | | Maintenance_Contract__r.Name, |
| | | Maintenance_Contract__r.Contract_End_Date__c, |
| | | Maintenance_Contract__r.Contract_Start_Date__c, |
| | | Maintenance_Contract__r.RecordType_DeveloperName__c, |
| | | Maintenance_Contract__r.Estimation_Id__r.Submit_quotation_day__c, |
| | | Maintenance_Contract__r.RecordType.DeveloperName |
| | | , ifHaveleftInPrevious__c |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c in: mcURFIDmap.keyset() |
| | | ]; |
| | | Set<ID> allURFAssetIDSet = new Set<ID>(); |
| | | Map<string, Maintenance_Contract_Asset__c> assetIDtoURF =new Map<string, Maintenance_Contract_Asset__c>(); |
| | | for (Maintenance_Contract_Asset__c mcaURF : mcURFList) { |
| | | // 找出来检索出来的维修合同保有中的最新的 |
| | | if (assetIDtoURF.containsKey(mcaURF.Asset__c)) { |
| | | Maintenance_Contract_Asset__c tempURF = |
| | | assetIDtoURF.get(mcaURF.Asset__c); |
| | | if (tempURF.endDate_sum__c < mcaURF.endDate_sum__c) { |
| | | assetIDtoURF.put(mcaURF.Asset__c, mcaURF); |
| | | } |
| | | } else { |
| | | assetIDtoURF.put(mcaURF.Asset__c, mcaURF); |
| | | } |
| | | allURFAssetIDSet.add(mcaURF.Asset__c); |
| | | } |
| | | List<asset> allURFAssetList =[select id, URF_Maintenance_Contract__c |
| | | from asset |
| | | where id in: allURFAssetIDSet]; |
| | | for (asset ass : allURFAssetList) { |
| | | Maintenance_Contract_Asset__c tempMCA = |
| | | assetIDtoURF.get(ass.Id); |
| | | ass.URF_Maintenance_Contract__c = tempMCA.Maintenance_Contract__c; |
| | | updateAssetMap.put(ass.id, ass); |
| | | |
| | | } |
| | | //URF限次合同2期 LY 20220908 end |
| | | //检索出历届保有设备 |
| | | list<Maintenance_Contract_Asset__c> allMCAList = |
| | | [select Id, Asset__c, Maintenance_Contract__c, |
| | |
| | | failedCount ++; |
| | | } |
| | | } |
| | | system.debug('11111111111111111111111updateAssetMap'+updateAssetMap.values()); |
| | | updateAsset (updateAssetMap.values()); |
| | | } |
| | | global void finish(Database.BatchableContext BC) { |
| | |
| | | if (TestIDList != null && TestIDList.size() > 0) { |
| | | return Database.getQueryLocator([select id from asset where Id in : TestIDList]); |
| | | }else{ |
| | | return Database.getQueryLocator([select id from asset]); |
| | | // 20221117 ljh DB202211258553 start |
| | | // return Database.getQueryLocator([select id from asset]); |
| | | return Database.getQueryLocator([select id from asset where IsCompetitorProduct = false AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET')]); |
| | | // 20221117 ljh DB202211258553 end |
| | | // return Database.getQueryLocator([select id from asset where Id in : assetList]); |
| | | } |
| | | } |
| | |
| | | global class AssetUseInfoBatch implements Database.Batchable<sObject> { |
| | | |
| | | private Integer dt; |
| | | |
| | | private Integer dt; |
| | | |
| | | global AssetUseInfoBatch() { |
| | | |
| | | } |
| | | // 测试用 |
| | | global AssetUseInfoBatch(Integer intDate) { |
| | | dt = intDate; |
| | | } |
| | | global AssetUseInfoBatch() { |
| | | |
| | | } |
| | | // 测试用 |
| | | global AssetUseInfoBatch(Integer intDate) { |
| | | dt = intDate; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | return Database.getQueryLocator([ |
| | | select Id, Use_Info__c from Asset |
| | | ]); |
| | | } |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | return Database.getQueryLocator([ |
| | | SELECT Id, Use_Info__c FROM Asset WHERE Category2__c ='本体' OR Product2.Can_Repair__c = '是' |
| | | ]); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, List<sObject> sList) { |
| | | List<Asset> updateList = new List<Asset>(); |
| | | Integer year = 0; |
| | | if (dt == null) { |
| | | year = Date.today().year(); |
| | | } else { |
| | | year = dt; |
| | | } |
| | | global void execute(Database.BatchableContext BC, List<sObject> sList) { |
| | | Oly_TriggerHandler.bypass('NFM010UpsertStatuAchievements'); |
| | | List<Asset> updateList = new List<Asset>(); |
| | | Integer year = 0; |
| | | if (dt == null) { |
| | | year = Date.today().year(); |
| | | } else { |
| | | year = dt; |
| | | } |
| | | |
| | | for (sObject sobj : sList) { |
| | | Asset ast = (Asset) sobj; |
| | | if (year == 2018) { |
| | | ast.Use_Info_2018__c = ast.Use_Info__c; |
| | | } else if (year == 2019) { |
| | | ast.Use_Info_2019__c = ast.Use_Info__c; |
| | | } else if (year == 2020) { |
| | | ast.Use_Info_2020__c = ast.Use_Info__c; |
| | | } else if (year == 2021) { |
| | | ast.Use_Info_2021__c = ast.Use_Info__c; |
| | | } else if (year == 2022) { |
| | | ast.Use_Info_2022__c = ast.Use_Info__c; |
| | | } else if (year == 2023) { |
| | | ast.Use_Info_2023__c = ast.Use_Info__c; |
| | | } else if (year == 2024) { |
| | | ast.Use_Info_2024__c = ast.Use_Info__c; |
| | | } else if (year == 2025) { |
| | | ast.Use_Info_2025__c = ast.Use_Info__c; |
| | | } else { |
| | | break; |
| | | } |
| | | updateList.add(ast); |
| | | } |
| | | for (sObject sobj : sList) { |
| | | Asset ast = (Asset) sobj; |
| | | if (year == 2018) { |
| | | ast.Use_Info_2018__c = ast.Use_Info__c; |
| | | } else if (year == 2019) { |
| | | ast.Use_Info_2019__c = ast.Use_Info__c; |
| | | } else if (year == 2020) { |
| | | ast.Use_Info_2020__c = ast.Use_Info__c; |
| | | } else if (year == 2021) { |
| | | ast.Use_Info_2021__c = ast.Use_Info__c; |
| | | } else if (year == 2022) { |
| | | ast.Use_Info_2022__c = ast.Use_Info__c; |
| | | } else if (year == 2023) { |
| | | ast.Use_Info_2023__c = ast.Use_Info__c; |
| | | } else if (year == 2024) { |
| | | ast.Use_Info_2024__c = ast.Use_Info__c; |
| | | } else if (year == 2025) { |
| | | ast.Use_Info_2025__c = ast.Use_Info__c; |
| | | } else { |
| | | break; |
| | | } |
| | | updateList.add(ast); |
| | | } |
| | | |
| | | if (updateList.size() > 0) { |
| | | update updateList; |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | |
| | | if (updateList.size() > 0) { |
| | | update updateList; |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | private class AssetUseInfoBatchTest { |
| | | |
| | | private static void init() { |
| | | Oly_TriggerHandler.bypass('NFM010UpsertStatuAchievements'); |
| | | List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; |
| | | if (rectHp.size() == 0) { |
| | | return; |
| | |
| | | ); |
| | | insert opp; |
| | | |
| | | Statu_Achievements__c Sac = new Statu_Achievements__c( |
| | | name = 'zhucan_one', |
| | | Opportunity__c = opp.id, |
| | | DeliveryDate__c = Date.today(), |
| | | FirstApproveDate__c = Date.valueOf('2016-08-10') |
| | | ); |
| | | insert Sac; |
| | | // Statu_Achievements__c Sac = new Statu_Achievements__c( |
| | | // name = 'zhucan_one', |
| | | // Opportunity__c = opp.id, |
| | | // DeliveryDate__c = Date.today(), |
| | | // FirstApproveDate__c = Date.valueOf('2016-08-10') |
| | | // ); |
| | | // insert Sac; |
| | | |
| | | Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI',Asset_Model_No__c='n01',Serial_Lot_No__c='S/N tracing',ProductCode_Ext__c='pc01',Manual_Entry__c=false); |
| | | pro1.Extend_new_product_gurantee__c = true; |
| | | pro1.Entend_gurantee_period__c = '两年'; |
| | | pro1.Extend_Gurantee_Start__c = Date.valueOf('2015-01-01'); |
| | | pro1.Extend_Gurantee_End__c = Date.valueOf('2017-01-04'); |
| | | pro1.Category2__c ='本体'; |
| | | insert pro1; |
| | | // 納入機器を作成する |
| | | Asset asset = new Asset(); |
| | |
| | | asset.Hospital__c = hp.Id; |
| | | asset.SerialNumber = 'testserial'; |
| | | asset.Product2Id = pro1.Id; |
| | | asset.Backorder__c = Sac.Id; |
| | | // asset.Backorder__c = Sac.Id; |
| | | asset.InstallDate = Date.valueOf('2017-05-10'); |
| | | asset.Guarantee_period_for_products__c = Date.valueOf('2018-05-10'); |
| | | |
| | | insert asset; |
| | | } |
| | | |
| | |
| | | global class AssetUseInfoSchedule implements Schedulable { |
| | | global void execute(SchedulableContext sc) { |
| | | // 保有设备前一年使用情况记录(每年12月31日执行) |
| | | if(Test.isRunningTest() || checkDate(date.today().addDays(-1))){ |
| | | if(Test.isRunningTest() || checkDate(date.today().addDays(-2))){ |
| | | Id execBTId = Database.executeBatch(new AssetUseInfoBatch(), 200); |
| | | } |
| | | } |
| New file |
| | |
| | | global class AssetWhereAbout2Batch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | global AssetWhereAbout2Batch() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | ///多年保修未到期且未签约合同的设备 |
| | | query = 'select id,AssetWhereabouts__c from Asset where IS_Extend_Gurantee_Txt__c = true and Gurantee_End_day1__c <0 and IF_Renewalrate_Target_Asset_F__c= 0 '; |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Asset> assList) { |
| | | Map<String,Asset> assMap = new Map<String,Asset>(); |
| | | for (Asset as1:assList) { |
| | | Asset ass = new Asset(); |
| | | ass.id = as1.id; |
| | | ass.AssetWhereabouts__c = '多年保修期内'; |
| | | |
| | | if (!assMap.containsKey(ass.id)) { |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } |
| | | if (assMap.values()!=null && assMap.values().size()!= 0) { |
| | | update assMap.values(); |
| | | } |
| | | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AssetWhereAbout2BatchTest { |
| | | @testSetup |
| | | private static void init(){ |
| | | |
| | | List<Product2> prs = new List<Product2>(); |
| | | |
| | | Product2 pr1 = new Product2( |
| | | Name = 'aiueo商品1_name', |
| | | ProductCode = 'OT1', |
| | | Asset_Model_No__c = 'aiueo商品12345678901234567890123456789012345678901234567890123456789012345678901234567890', |
| | | IsActive = true, |
| | | SFDA_Status__c = '有効' |
| | | ); |
| | | prs.add(pr1); |
| | | Product2 pr2 = new Product2( |
| | | Name = 'aiueo商品2_name', |
| | | ProductCode = 'OT2', |
| | | Asset_Model_No__c = 'aiueo商品2', |
| | | IsActive = false, // 同期されない |
| | | SFDA_Status__c = '不要' |
| | | ); |
| | | prs.add(pr2); |
| | | Product2 pr3 = new Product2( |
| | | Name = 'aiueo商品3_name', |
| | | ProductCode = 'OT3', |
| | | Asset_Model_No__c = 'aiueo商品3', |
| | | IsActive = true, |
| | | SFDA_Status__c = '準備中' |
| | | ); |
| | | prs.add(pr3); |
| | | insert prs; |
| | | |
| | | Product_Set__c ps1 = new Product_Set__c(); |
| | | ps1.Name = 'セット品1'; |
| | | ps1.Product_Set_CD__c = '111111'; |
| | | ps1.Description__c = '説明'; |
| | | ps1.Qty__c = 10; |
| | | //ps1.Valid__c = true; |
| | | ps1.Valid_Date__c = date.today().addDays(-5); |
| | | insert ps1; |
| | | |
| | | Product_Set_Detail__c psd1 = new Product_Set_Detail__c(); |
| | | psd1.Product_Set__c = ps1.id; |
| | | psd1.Price__c = 100; |
| | | psd1.Quantity__c = 10; |
| | | psd1.Product__c = pr1.id; |
| | | insert psd1; |
| | | |
| | | Product_Set_Detail__c psd2 = new Product_Set_Detail__c(); |
| | | psd2.Product_Set__c = ps1.id; |
| | | psd2.Price__c = 100; |
| | | psd2.Quantity__c = 10; |
| | | psd2.Product__c = pr3.id; |
| | | insert psd2; |
| | | |
| | | List<Product2__c> prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | |
| | | |
| | | pr3 = [select Id from Product2 where Id = :pr3.Id]; |
| | | pr3.SFDA_Status__c = '停止'; |
| | | update pr3; |
| | | prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | System.assertEquals(2, prcs.size()); |
| | | pr2 = [select Id from Product2 where Id = :pr2.Id]; |
| | | pr2.IsActive = true; |
| | | update pr2; |
| | | prcs = [select Id, Name, Name_Text__c, OT_CODE_Text__c from Product2__c where Product2__c in :prs order by Product2__c.Name]; |
| | | |
| | | System.assertEquals('aiueo商品1234567890123456789012345678901234567890123456789012345678901234567890123', prcs[0].Name); |
| | | System.assertEquals('aiueo商品2', prcs[1].Name); |
| | | System.assertEquals('aiueo商品3', prcs[2].Name); |
| | | System.assertEquals('aiueo商品1_name', prcs[0].Name_Text__c); |
| | | System.assertEquals('aiueo商品2_name', prcs[1].Name_Text__c); |
| | | System.assertEquals('aiueo商品3_name', prcs[2].Name_Text__c); |
| | | System.assertEquals('OT1', prcs[0].OT_CODE_Text__c); |
| | | System.assertEquals('OT2', prcs[1].OT_CODE_Text__c); |
| | | System.assertEquals('OT3', prcs[2].OT_CODE_Text__c); |
| | | |
| | | pr1.SFDA_Status__c = '新製品申請中'; |
| | | pr2.SFDA_Status__c = '準備中'; |
| | | pr3.SFDA_Status__c = '有効(再申請中)'; |
| | | update new Product2[] {pr1, pr2, pr3}; |
| | | prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | |
| | | |
| | | //delete pr3; |
| | | prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | System.assertEquals(3, prcs.size()); |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | | depart1.Name = '*'; |
| | | depart1.Department_Name__c = '診療科1'; |
| | | depart1.ParentId = dc1s[0].Id; |
| | | depart1.Department_Class__c = dc1s[0].Id; |
| | | depart1.Hospital__c = company1.Id; |
| | | |
| | | insert new Account[] {depart1}; |
| | | |
| | | Asset ast1 = new Asset(); |
| | | ast1.SerialNumber = 'abcdefg'; |
| | | ast1.Name = '测试资产1'; |
| | | ast1.AccountId = depart1.Id; |
| | | ast1.Department_Class__c = dc1s[0].Id; |
| | | ast1.Hospital__c = company1.Id; |
| | | ast1.Product2Id = pr1.Id; |
| | | ast1.Guarantee_period_for_products__c = Date.today(); |
| | | ast1.InstallDate = Date.today(); |
| | | //ast1.Manage_type__c = '个体管理'; |
| | | ast1.FirstApproveDate_old__c = Date.today().addDays(-30); |
| | | ast1.Loaner_accsessary__c = true; |
| | | ast1.Gurantee_End_day1__c = -100; |
| | | ast1.IS_Extend_Gurantee_Txt__c = true; |
| | | ast1.IF_Renewalrate_Target_Asset__c = '0'; |
| | | insert ast1; |
| | | |
| | | Asset ast2 = new Asset(); |
| | | ast2.SerialNumber = '12345'; |
| | | ast2.Name = '测试资产2'; |
| | | ast2.AccountId = depart1.Id; |
| | | ast2.Department_Class__c = dc1s[0].Id; |
| | | ast2.Hospital__c = company1.Id; |
| | | ast2.Product2Id = pr2.Id; |
| | | ast2.Guarantee_period_for_products__c = Date.today(); |
| | | ast2.InstallDate = Date.today(); |
| | | //ast2.Manage_type__c = '个体管理'; |
| | | ast2.IS_Extend_Gurantee_Txt__c = true; |
| | | ast2.Loaner_accsessary__c = true; |
| | | ast2.Gurantee_End_day1__c = -100; |
| | | ast2.IF_Renewalrate_Target_Asset__c = '0'; |
| | | insert ast2; |
| | | |
| | | pr1.Extend_new_product_gurantee__c = true; |
| | | pr1.Extend_Gurantee_Start__c = Date.today().addDays(-60); |
| | | pr1.Extend_Gurantee_End__c = Date.today().addDays(60); |
| | | update pr1; |
| | | |
| | | pr2.Extend_new_product_gurantee__c = false; |
| | | update pr2; |
| | | } |
| | | static testMethod void testMethod1() { |
| | | System.Test.startTest(); |
| | | Oly_TriggerHandler.bypass(Product2Handler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(AssetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(FixtureSetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyTriggerHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyEquipmentSetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyEquipmentSetDetailHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(ContactTriggerHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass('AssetTrigger'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractTrigger'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractAfterUpdate'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractBeforeDelete'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractHpDeptUpd'); |
| | | Oly_TriggerHandler.bypass('NFM106Controller'); |
| | | Oly_TriggerHandler.bypass('NFM106Trigger'); |
| | | Oly_TriggerHandler.bypass('AssetRecordTypeUpd'); |
| | | Oly_TriggerHandler.bypass('NFM101Controller'); |
| | | Oly_TriggerHandler.bypass('NFM001Controller'); |
| | | Oly_TriggerHandler.bypass('SyncProduct2'); |
| | | List<Asset> assList = [select id ,name,IS_Extend_Gurantee_Txt__c,Gurantee_End_day1__c,IF_Renewalrate_Target_Asset_F__c,AssetWhereabouts__c from Asset ]; |
| | | system.debug('@@@@@@@@@@@@设备集合='+assList); |
| | | Database.executeBatch(new AssetWhereAbout2Batch(),200); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global class AssetWhereabouts implements Database.Batchable<sObject>,Database.Stateful { |
| | | public String query; |
| | | public BatchIF_Log__c iflog ; |
| | | public Date toDay = Date.today(); |
| | | public List < String > assetIdList; |
| | | global AssetWhereabouts() { |
| | | this.query = query; |
| | | } |
| | | global AssetWhereabouts(List < String > assetIdList) { |
| | | this.query = query; |
| | | this.assetIdList = assetIdList; |
| | | } |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'PushNotification'; |
| | | iflog.Log__c = 'AssetWhereabouts start\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | | query = 'select id,Asset__r.AssetWhereabouts__c,Maintenance_Contract__r.status__c ,Asset__r.id,Maintenance_Contract__r.id,endDateGurantee_Text__c ' |
| | | +' from Maintenance_Contract_Asset__c where Maintenance_Contract__r.RecordType_Name__c =\'多年保修合同\' and endDateGurantee_Text__c < :toDay and Asset__r.AssetWhereabouts__c!=\'服务合同\''; |
| | | if (assetIdList != null && assetIdList.size() > 0) { |
| | | query += ' and Asset__c in :assetIdList '; |
| | | } |
| | | query += ' order by CreatedDate '; |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Maintenance_Contract_Asset__c> mcaList) { |
| | | Map<String,Asset> assMap = new Map<String,Asset>(); |
| | | // 用作查询合同中的服务合同 |
| | | Set<String> assSet = new Set<String>(); |
| | | Set<String> fuwuSet = new Set<String>(); |
| | | // 用作查询一般维修 |
| | | Set<String> weixiuSet = new Set<String>(); |
| | | Map<String,Repair__c> mcMap = new Map<String,Repair__c>(); |
| | | for (Maintenance_Contract_Asset__c mca: mcaList) { |
| | | assSet.add(mca.Asset__r.id); |
| | | weixiuSet.add(mca.Asset__r.id); |
| | | } |
| | | |
| | | // 查询符合条件的修理 |
| | | List<Repair__c> reList = [select id,Maintenance_Contract__r.id,Status1__c,Failure_Occurrence_Date__c,CreatedDate,Delivered_Product__c |
| | | from Repair__c |
| | | where Status1__c != '0.取消' and Status1__c != '0.删除' and Status2__c != '00.删除' and Status2__c != '00.取消' |
| | | and Maintenance_Contract__c = null and Delivered_Product__c in :weixiuSet order by CreatedDate ]; |
| | | for (Repair__c re: reList) { |
| | | if ( mcMap.get(re.Delivered_Product__c)==null) { |
| | | mcMap.put(re.Delivered_Product__c,re); |
| | | } |
| | | // 取最近一期的修理记录 |
| | | if( mcMap.get(re.Delivered_Product__c)!=null && re.CreatedDate>mcMap.get(re.Delivered_Product__c).CreatedDate){ |
| | | mcMap.remove(re.Delivered_Product__c); |
| | | mcMap.put(re.Delivered_Product__c,re); |
| | | } |
| | | } |
| | | // 查询是否有合同中的服务合同 |
| | | list<Maintenance_Contract_Asset__c> mcaList2 = [select Id,Asset__r.id from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__r.RecordType_Name__c ='服务合同' |
| | | and Maintenance_Contract__r.status__c ='契約' and Asset__c in :assSet]; |
| | | for (Maintenance_Contract_Asset__c mca: mcaList2) { |
| | | fuwuSet.add(mca.Asset__r.id); |
| | | } |
| | | |
| | | |
| | | for (Maintenance_Contract_Asset__c mca: mcaList) { |
| | | Asset ass = new Asset(); |
| | | Date PassDay = mca.endDateGurantee_Text__c.addyears(1); |
| | | Boolean isXiuli = false; |
| | | // 判断修理是否是未来1年内 |
| | | if (mcMap.get(mca.Asset__r.id)!=null &&mcMap.get(mca.Asset__r.id).Failure_Occurrence_Date__c>mca.endDateGurantee_Text__c && mcMap.get(mca.Asset__r.id).Failure_Occurrence_Date__c < PassDay) { |
| | | isXiuli = true; |
| | | } |
| | | // 去向:服务合同 关联的执行中合同记录为【服务合同】状态为契约 |
| | | if (fuwuSet.contains(mca.Asset__r.id)) { |
| | | ass.id = mca.Asset__r.id; |
| | | ass.AssetWhereabouts__c = '服务合同'; |
| | | if (assMap.containsKey(ass.id)&&assMap.get(ass.id).AssetWhereabouts__c =='其他') { |
| | | assMap.remove(ass.id); |
| | | assMap.put(ass.id,ass); |
| | | }else{ |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } |
| | | // 去向:一般维修 |
| | | else if(mca.Maintenance_Contract__r.status__c != '契約' && isXiuli){ |
| | | ass.id = mca.Asset__c; |
| | | ass.AssetWhereabouts__c = '一般维修'; |
| | | if (assMap.containsKey(ass.id)&&assMap.get(ass.id).AssetWhereabouts__c =='其他') { |
| | | assMap.remove(ass.id); |
| | | assMap.put(ass.id,ass); |
| | | }else{ |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } else { |
| | | // 去向:其他 |
| | | ass.id = mca.Asset__c; |
| | | ass.AssetWhereabouts__c = '其他'; |
| | | |
| | | if (!assMap.containsKey(ass.id)) { |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } |
| | | } |
| | | system.debug('更新数据='+assMap.values()); |
| | | if (assMap.values()!=null && assMap.values().size()!= 0) { |
| | | update assMap.values(); |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | iflog.Log__c += '\nAssetWhereabouts end'; |
| | | String tmp = iflog.ErrorLog__c; |
| | | integer i=0; |
| | | i++; |
| | | if (tmp.length() >= 5000) { |
| | | tmp = tmp.substring(0, 5000); |
| | | tmp += ' ...have more lines...'; |
| | | iflog.ErrorLog__c = tmp; |
| | | } |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | update iflog; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AssetWhereaboutsTest { |
| | | @testSetup |
| | | private static void init(){ |
| | | Oly_TriggerHandler.bypass(Product2Handler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(AssetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(FixtureSetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyTriggerHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyEquipmentSetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyEquipmentSetDetailHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(ContactTriggerHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass('AssetTrigger'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractTrigger'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractAfterUpdate'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractBeforeDelete'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractHpDeptUpd'); |
| | | Oly_TriggerHandler.bypass('NFM106Controller'); |
| | | Oly_TriggerHandler.bypass('NFM101Controller'); |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com',Job_Category__c = '销售服务', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert MacOwner; |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = |
| | | Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | |
| | | hospital.Name = 'test hospita/l'; |
| | | insert hospital; |
| | | |
| | | // 戦略科室を得る |
| | | List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI']; |
| | | |
| | | // // 診療科を作る |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_GI').getRecordTypeId(); |
| | | dep.Name = 'test de/p'; |
| | | dep.ParentId = strategicDep[0].Id; |
| | | dep.Department_Class__c = strategicDep[0].Id; |
| | | dep.Hospital__c = hospital.Id; |
| | | insert dep; |
| | | |
| | | // 製品を作る |
| | | Product2 productA = new Product2( Name='テスト商品', Maintenance_Price_Year__c = 12000, Manual_Entry__c = false,IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n01', |
| | | ProductCode_Ext__c='pc01'); |
| | | insert productA; |
| | | |
| | | // 第一期合同 |
| | | Maintenance_Contract__c contract1 = new Maintenance_Contract__c(); |
| | | contract1.Name = 'tect contract1'; |
| | | contract1.Hospital__c = hospital.Id; |
| | | contract1.Department_Class__c = strategicDep[0].Id; |
| | | contract1.Department__c = dep.Id; |
| | | contract1.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract1.Payment_Plan_Sum_First__c = 1; |
| | | contract1.Status__c = '契約'; |
| | | contract1.Maintenance_Contract_No__c = '11123'; |
| | | contract1.recordtypeId = |
| | | Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | contract1.Not_Upper_limit_reason__c = ' 1'; |
| | | contract1.Contract_Start_Date__c = Date.today().addDays( -10); |
| | | contract1.Contract_End_Date__c = Date.today().addDays( 5); |
| | | contract1.SalesOfficeCode_selection__c = '北京RC'; |
| | | insert contract1; |
| | | |
| | | // 第二期合同 |
| | | Maintenance_Contract__c contract12 = new Maintenance_Contract__c(); |
| | | contract12.Name = 'tect contract12'; |
| | | contract12.Not_Upper_limit_reason__c = 'tect contract12'; |
| | | contract12.RecordtypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('VM_Contract').getRecordTypeId(); |
| | | contract12.Hospital__c = hospital.Id; |
| | | contract1.Switch_TimeBase_WF__c = true; |
| | | contract12.Department_Class__c = strategicDep[0].Id; |
| | | contract12.Department__c = dep.Id; |
| | | contract12.Service_Contract_Staff__c = UserInfo.getUserId(); |
| | | contract12.Maintenance_Contract_No__c = 'tect contract12'; |
| | | contract12.Status__c = '契約満了'; |
| | | contract12.Contract_Start_Date__c = Date.today().addMonths(-13); |
| | | contract12.Contract_End_Date__c = Date.today().addMonths(-1); |
| | | insert contract12; |
| | | // insert new Maintenance_Contract__c[] {contract1}; |
| | | |
| | | System.debug('contract1 =='+ contract1 ); |
| | | List<Maintenance_Contract__c> listmc = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | // for (Maintenance_Contract__c mc:listmc) { |
| | | // mc1.id = mc.id; |
| | | // mc1.Status__c = '契約'; |
| | | // update mc1; |
| | | // System.debug('更新成功'+mc1); |
| | | |
| | | // } |
| | | // List<Maintenance_Contract__c> listmc1 = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | System.debug('listmc'+listmc); |
| | | // System.debug('contract12.Status__c =='+ contract12.Status__c ); |
| | | Asset asset = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset.RecordTypeId = System.Label.Asset_RecordType; |
| | | asset.SerialNumber = 'ass01'; |
| | | asset.Name = 'ass01'; |
| | | asset.AccountId = dep.Id; |
| | | asset.Department_Class__c = strategicDep[0].Id; |
| | | asset.Hospital__c = hospital.Id; |
| | | asset.Product2Id = productA.Id; |
| | | asset.Quantity = 1; |
| | | asset.Status = '有库存'; |
| | | asset.Manage_type__c = '个体管理'; |
| | | asset.Loaner_accsessary__c = false; |
| | | asset.Out_of_wh__c = 0; |
| | | asset.Salesdepartment__c = '1.华北营业本部'; |
| | | asset.Internal_asset_location__c = '北京 备品中心'; |
| | | asset.Product_category__c = 'GI'; |
| | | asset.Equipment_Type__c = '产品试用'; |
| | | asset.SalesProvince__c = '北京'; |
| | | asset.CurrentContract__c = contract1.Id; |
| | | asset.CurrentContract_Asset_Price__c = 0; |
| | | insert asset; |
| | | Asset asset2 = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset2.RecordTypeId = System.Label.Asset_RecordType; |
| | | asset2.SerialNumber = 'ass02'; |
| | | asset2.Name = 'ass02'; |
| | | asset2.AccountId = dep.Id; |
| | | asset2.Department_Class__c = strategicDep[0].Id; |
| | | asset2.Hospital__c = hospital.Id; |
| | | asset2.Product2Id = productA.Id; |
| | | asset2.Quantity = 1; |
| | | asset2.Status = '有库存'; |
| | | asset2.Manage_type__c = '个体管理'; |
| | | asset2.Loaner_accsessary__c = false; |
| | | asset2.Out_of_wh__c = 0; |
| | | asset2.Salesdepartment__c = '1.华北营业本部'; |
| | | asset2.Internal_asset_location__c = '北京 备品中心'; |
| | | asset2.Product_category__c = 'GI'; |
| | | asset2.Equipment_Type__c = '产品试用'; |
| | | asset2.SalesProvince__c = '北京'; |
| | | asset2.CurrentContract__c = contract12.Id; |
| | | asset2.CurrentContract_Asset_Price__c = 0; |
| | | insert asset2; |
| | | //System.Test.stopTest(); |
| | | |
| | | Maintenance_Contract_Asset__c contract1asset1 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset1.Asset__c = asset.Id; |
| | | contract1asset1.endDateGurantee_Text__c = Date.today().addYears(-1); |
| | | contract1asset1.Maintenance_Contract__c = contract1.Id; |
| | | contract1asset1.Estimate_List_Price_All_Manual__c = 1000; |
| | | insert contract1asset1; |
| | | // contract1asset.Maintenance_Contract_Asset_Estimate__c = mcae1.id; |
| | | Maintenance_Contract_Asset__c contract1asset2 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset2.Asset__c = asset2.Id; |
| | | contract1asset2.endDateGurantee_Text__c = Date.today().addYears(-1); |
| | | contract1asset2.Maintenance_Contract__c = contract12.Id; |
| | | insert contract1asset2; |
| | | // insert new list<Maintenance_Contract_Asset__c> {contract1asset1,contract1asset2 }; |
| | | Maintenance_Contract_Asset__c contract1asset3 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset3.Asset__c = asset.Id; |
| | | contract1asset3.endDateGurantee_Text__c = Date.today().addYears(-1); |
| | | contract1asset3.Maintenance_Contract__c = contract12.Id; |
| | | insert contract1asset3; |
| | | |
| | | // repair01.Account__c = dep.Id; |
| | | |
| | | // // repair01.Repair_Start_Date__c = Date.newInstance(2022,7,20); |
| | | |
| | | // repair01.Department_Class__c = strategicDep[0].Id; |
| | | // repair01.Hospital__c = hospital.Id; |
| | | // repair01.Dealer__c = dep.Id; |
| | | // // repair01.Status1__c = '3.维修阶段'; |
| | | // repair01.Delivered_Product__c = asset.Id; |
| | | |
| | | // insert repair01; |
| | | Repair__c repair1 = new Repair__c(); |
| | | repair1.Service_Repair_No__c = 'repair1'; |
| | | repair1.Hospital__c = hospital.Id; |
| | | repair1.Account__c = dep.Id; |
| | | repair1.Department_Class__c = strategicDep[0].id; |
| | | repair1.Delivered_Product__c = asset.Id; |
| | | repair1.Repair_List_Price__c = 100; |
| | | repair1.Billing_Amount__c = 10; |
| | | repair1.Paid_Amount__c = 1; |
| | | repair1.DateReceiptQuestions__c = Date.newInstance(2022,7,20); |
| | | repair1.Failure_Occurrence_Date__c = Date.today().addDays(-1); |
| | | repair1.Repair_Returned_To_HP_Date__c = Date.today().addDays(3); |
| | | repair1.Repair_Shipped_Date__c = Date.today().addDays(1); |
| | | System.debug('repair1.Maintenance_Contract__c =='+ repair1.Maintenance_Contract__c ); |
| | | System.debug('repair01.Status1__c =='+ repair1.Status1__c ); |
| | | system.debug('day=='+Date.today().addYears(-1)); |
| | | System.debug('repair01.DateReceiptQuestions__c =='+ repair1.DateReceiptQuestions__c ); |
| | | insert repair1; |
| | | } |
| | | @isTest |
| | | private static void testMethod1() { |
| | | |
| | | System.Test.startTest(); |
| | | Maintenance_Contract__c mc1 = new Maintenance_Contract__c(); |
| | | |
| | | List<Maintenance_Contract__c> listmc = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | for (Maintenance_Contract__c mc:listmc) { |
| | | mc1.id = mc.id; |
| | | mc1.Status__c = '契約'; |
| | | update mc1; |
| | | System.debug('更新成功'+mc1); |
| | | |
| | | } |
| | | List<Maintenance_Contract__c> listmc1 = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | System.debug('listmc'+listmc1); |
| | | |
| | | Database.executeBatch(new AssetWhereabouts(),200); |
| | | System.Test.stopTest(); |
| | | } |
| | | // private static void testMethod2() { |
| | | // System.Test.startTest(); |
| | | // select id, |
| | | // Database.executeBatch(new AssetWhereabouts(),200); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | @isTest |
| | | private class AttachmentTriggerTest { |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'}); |
| | | } |
| | | |
| | | |
| | | @isTest |
| | | static void test_method_one() { |
| | |
| | | opp.Name = 'GZ-SP-NFM007_1'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = date.newinstance(2023, 12, 30); |
| | | opp.Stock_apply_status__c = '申请中'; |
| | | insert opp; |
| | | |
| | |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'test hospital'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.Is_Active__c = '草案中'; |
| | | hospital.Attribute_Type__c = '卫生部'; |
| | | hospital.Speciality_Type__c = '综合医院'; |
| | | hospital.Grade__c = '一级'; |
| | |
| | | contact2.LastName = 'test1经销商'; |
| | | insert contact2; |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | Aws_Data_Id__c = '123456' |
| | | )); |
| | | |
| | | System.Test.startTest(); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | AWSServiceTool2.EncryptPushFuture(null,null); |
| | | //insert att1; |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = hospital.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | |
| | | ); |
| | | insert att; |
| | | |
| | |
| | | opp.Name = 'GZ-SP-NFM007_1'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.CloseDate = date.newinstance(2022, 11, 30); |
| | | opp.CloseDate = date.newinstance(2023, 11, 30); |
| | | opp.Stock_apply_status__c = '申请中'; |
| | | insert opp; |
| | | |
| | |
| | | } |
| | | @isTest |
| | | static void test_method_6() { |
| | | List<RecordType> rectC = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectC.size() == 0) { |
| | | return; |
| | | User thisUser = [select Id from User where Id = :UserInfo.getUserId() ]; |
| | | System.runAs ( thisUser ){ |
| | | List<RecordType> rectC = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectC.size() == 0) { |
| | | return; |
| | | } |
| | | Account act1 = new Account(); |
| | | act1.Name = 'TestAccount01'; |
| | | act1.RecordTypeId = rectC[0].Id; |
| | | |
| | | upsert act1; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '契約']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Account act2 = new Account(); |
| | | act2.Name = 'TestAccount02'; |
| | | act2.Business_Assistant__c = getUser().id; |
| | | act2.RecordTypeId = rectCo[0].Id; |
| | | act2.ParentId = act1.Id; |
| | | |
| | | upsert act2; |
| | | |
| | | Consumable_order__c co = new Consumable_order__c(); |
| | | co.Name = 'TestCo'; |
| | | co.Order_status__c = '草案中'; |
| | | co.Order_effective_contact__c = act2.id; |
| | | |
| | | insert co; |
| | | System.Test.startTest(); |
| | | |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = co.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | |
| | | insert att; |
| | | |
| | | delete att; |
| | | |
| | | System.Test.stopTest(); |
| | | } |
| | | Account act1 = new Account(); |
| | | act1.Name = 'TestAccount01'; |
| | | act1.RecordTypeId = rectC[0].Id; |
| | | |
| | | upsert act1; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '契約']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Account act2 = new Account(); |
| | | act2.Name = 'TestAccount02'; |
| | | act2.Business_Assistant__c = getUser().id; |
| | | act2.RecordTypeId = rectCo[0].Id; |
| | | act2.ParentId = act1.Id; |
| | | |
| | | upsert act2; |
| | | |
| | | Consumable_order__c co = new Consumable_order__c(); |
| | | co.Name = 'TestCo'; |
| | | co.Order_status__c = '草案中'; |
| | | co.Order_effective_contact__c = act2.id; |
| | | |
| | | insert co; |
| | | System.Test.startTest(); |
| | | |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = co.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | |
| | | insert att; |
| | | |
| | | delete att; |
| | | |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | |
| | | @isTest |
| | |
| | | |
| | | } |
| | | |
| | | // 20230206 lt start |
| | | @isTest |
| | | static void test_method_9() { |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | // 病院を作る |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'test hospital'; |
| | | hospital.Is_Active__c = '草案中'; |
| | | hospital.Attribute_Type__c = '卫生部'; |
| | | hospital.Speciality_Type__c = '综合医院'; |
| | | hospital.Grade__c = '一级'; |
| | | hospital.OCM_Category__c = 'SLTV'; |
| | | hospital.Is_Medical__c = '医疗机构'; |
| | | hospital.State_Master__c = al.id; |
| | | // hospital.City_Master__c = al2.id; |
| | | hospital.Town__c = '东京'; |
| | | insert hospital; |
| | | |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | insert ada; |
| | | |
| | | System.Test.startTest(); |
| | | |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = hospital.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert att; |
| | | att.Name = 'test01'; |
| | | update att; |
| | | |
| | | Attachment att1 = new Attachment( |
| | | Name = '2test', |
| | | ParentId = ada.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert att1; |
| | | att1.Name = '2test01'; |
| | | update att1; |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | // 20230206 lt end |
| | | |
| | | private static User getUser() { |
| | | String timenow = Datetime.now().format('yyyyMMddHHmmss'); |
| | | User usr = new User(Test_staff__c = true, LastName = 'TestZY', FirstName = 'TestZY', |
| | |
| | | } |
| | | |
| | | // MZY SWAG-BXXBKA 2021-02-19 end |
| | | |
| | | class HttpMock implements HttpCalloutMock{ |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | if(request.getEndpoint().contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | // } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | public PageReference editContact() { |
| | | if (conId != null && conId != '') { |
| | | newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c, |
| | | newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c, |
| | | //LastName_Encrypted__c,Phone_Encrypted__c, //zhj 新方案改造 2022-12-19 |
| | | FirstName, LastName,AWS_Data_Id__c |
| | | from Contact where Id = :conId]; |
| | | } |
| | |
| | | |
| | | Test.startTest(); |
| | | B_Test bt = new B_Test(); |
| | | bt.newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c, |
| | | bt.newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c, |
| | | //LastName_Encrypted__c,Phone_Encrypted__c, //zhj 新方案改造 2022-12-19 |
| | | FirstName, LastName,AWS_Data_Id__c |
| | | from Contact where Id = :con.id]; |
| | | Contact searchCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c, |
| New file |
| | |
| | | public without sharing class BatchSelectRepairPDFDelete { |
| | | public void deletePDF(List<Repair__c> repList){ |
| | | List<String> attachmentNameList = new List<String>(); |
| | | List<Attachment> isGeneratedPDFList = new List<Attachment>(); |
| | | for(Repair__c re : repList){ |
| | | attachmentNameList.add(re.name + '_' + 'MaintenanceCommission.pdf'); |
| | | } |
| | | isGeneratedPDFList = [select id from Attachment where name IN:attachmentNameList]; |
| | | System.debug(LoggingLevel.INFO, '*** isGeneratedPDFList: ' + isGeneratedPDFList); |
| | | if(isGeneratedPDFList.size() > 0){ |
| | | delete isGeneratedPDFList; |
| | | } |
| | | } |
| | | |
| | | public void createPDF(List<Repair__c> repList){ |
| | | PageReference pdfPage; |
| | | List<Attachment> attachments = new List<Attachment>(); |
| | | for(Repair__c re : repList){ |
| | | pdfPage = new PageReference('/apex/MaintenanceCommissionPDF?id=' + re.Id); |
| | | Blob pdfBody; |
| | | if(Test.isRunningTest()) { |
| | | pdfBody = blob.valueOf('Unit.Test'); |
| | | } else { |
| | | pdfBody = pdfPage.getContentAsPDF(); |
| | | } |
| | | Attachment attach = new Attachment(); |
| | | attach.Body = pdfBody; |
| | | attach.Name = re.name + '_' + 'MaintenanceCommission.pdf'; |
| | | attach.ParentId = re.id; |
| | | attachments.add(attach); |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** attachments: ' + attachments); |
| | | insert attachments; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>46.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public with sharing class BatchSelectRepairPageController { |
| | | public RetrievalData RevalInfo { get; set; } |
| | | public List<RepairData> RAInfoList { get; set; } |
| | | public List<Repair__c> RepairList { get; set; } |
| | | public List<String> repairIdList{ get; set; } |
| | | public List<SelectOption> StatusItems1 { get; private set; } |
| | | public List<SelectOption> StatusItems { get; private set; } |
| | | public List<SelectOption> SiteRepairItems { get; private set; } |
| | | public String pdfURL { get; private set; } |
| | | public Integer RACount { |
| | | get { return RAInfoList == null ? 0 : RAInfoList.size(); } |
| | | } |
| | | |
| | | public BatchSelectRepairPageController() { |
| | | StatusItems = new List<SelectOption>(); |
| | | StatusItems.add(new SelectOption('','--无--')); |
| | | StatusItems.add(new SelectOption('00.申请完毕','00.申请完毕')); |
| | | StatusItems.add(new SelectOption('01.分公司受理完毕','01.分公司受理完毕')); |
| | | StatusItems.add(new SelectOption('02.RC受理完毕','02.RC受理完毕')); |
| | | StatusItems.add(new SelectOption('03.报价检查结束','03.报价检查结束')); |
| | | StatusItems.add(new SelectOption('04.报价跟进中','04.报价跟进中')); |
| | | StatusItems.add(new SelectOption('05.报价同意完备','05.报价同意完备')); |
| | | StatusItems.add(new SelectOption('06.零件齐备','06.零件齐备')); |
| | | StatusItems.add(new SelectOption('07.修理開始','07.修理開始')); |
| | | StatusItems.add(new SelectOption('08.修理预计完成','08.修理预计完成')); |
| | | StatusItems.add(new SelectOption('09.修理完成','09.修理完成')); |
| | | StatusItems.add(new SelectOption('10.最终检查完成','10.最终检查完成')); |
| | | StatusItems.add(new SelectOption('11.RC修理品已返送','11.RC修理品已返送')); |
| | | StatusItems.add(new SelectOption('12.发票已发送','12.发票已发送')); |
| | | StatusItems.add(new SelectOption('13.已返送到用户','13.已返送到用户')); |
| | | StatusItems.add(new SelectOption('14.收到验收单','14.收到验收单')); |
| | | StatusItems.add(new SelectOption('15.验收单签收复核通过','15.验收单签收复核通过')); |
| | | StatusItems.add(new SelectOption('16.部分付款','16.部分付款')); |
| | | StatusItems.add(new SelectOption('16.完毕','16.完毕')); |
| | | StatusItems.add(new SelectOption('17.付款完毕','17.付款完毕')); |
| | | StatusItems.add(new SelectOption('00.取消','00.取消')); |
| | | StatusItems.add(new SelectOption('00.删除','00.删除')); |
| | | StatusItems.add(new SelectOption('00.关闭','00.关闭')); |
| | | |
| | | StatusItems1 = new List<SelectOption>(); |
| | | StatusItems1.add(new SelectOption('','--无--')); |
| | | StatusItems1.add(new SelectOption('0.申请完毕','0.申请完毕')); |
| | | StatusItems1.add(new SelectOption('2.维修报价阶段','2.维修报价阶段')); |
| | | StatusItems1.add(new SelectOption('3.维修阶段','3.维修阶段')); |
| | | StatusItems1.add(new SelectOption('4.修理品返送阶段','4.修理品返送阶段')); |
| | | StatusItems1.add(new SelectOption('5.完毕','5.完毕')); |
| | | StatusItems1.add(new SelectOption('0.删除','0.删除')); |
| | | StatusItems1.add(new SelectOption('0.取消','0.取消')); |
| | | |
| | | SiteRepairItems = new List<SelectOption>(); |
| | | SiteRepairItems.add(new SelectOption('','--无--')); |
| | | SiteRepairItems.add(new SelectOption('RC修理','RC修理')); |
| | | SiteRepairItems.add(new SelectOption('直送SORC修理','直送SORC修理')); |
| | | SiteRepairItems.add(new SelectOption('直送OGZ修理','直送OGZ修理')); |
| | | SiteRepairItems.add(new SelectOption('办事处修理','办事处修理')); |
| | | SiteRepairItems.add(new SelectOption('现场修理','现场修理')); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public void init(){ |
| | | RevalInfo = new RetrievalData(); |
| | | } |
| | | |
| | | // public List<SelectOption> getworkLocationSelect() { |
| | | // List<SelectOption> workLocationSelect = new List<SelectOption>(); |
| | | // workLocationSelect.add(new SelectOption('','--无--')); |
| | | // workLocationSelect.add(new SelectOption('北京办事处','北京办事处')); |
| | | // workLocationSelect.add(new SelectOption('天津办事处','天津办事处')); |
| | | // workLocationSelect.add(new SelectOption('河北办事处','河北办事处')); |
| | | // workLocationSelect.add(new SelectOption('济南办事处','济南办事处')); |
| | | // workLocationSelect.add(new SelectOption('青岛办事处','青岛办事处')); |
| | | // workLocationSelect.add(new SelectOption('内蒙办事处','内蒙办事处')); |
| | | // workLocationSelect.add(new SelectOption('黑龙江办事处','黑龙江办事处')); |
| | | // workLocationSelect.add(new SelectOption('吉林办事处','吉林办事处')); |
| | | // workLocationSelect.add(new SelectOption('沈阳办事处','沈阳办事处')); |
| | | // workLocationSelect.add(new SelectOption('大连办事处','大连办事处')); |
| | | // workLocationSelect.add(new SelectOption('陕西办事处','陕西办事处')); |
| | | // workLocationSelect.add(new SelectOption('青海办事处','青海办事处')); |
| | | // workLocationSelect.add(new SelectOption('宁夏办事处','宁夏办事处')); |
| | | // workLocationSelect.add(new SelectOption('甘肃办事处','甘肃办事处')); |
| | | // workLocationSelect.add(new SelectOption('新疆办事处','新疆办事处')); |
| | | // workLocationSelect.add(new SelectOption('山西办事处','山西办事处')); |
| | | // workLocationSelect.add(new SelectOption('河南办事处','河南办事处')); |
| | | // workLocationSelect.add(new SelectOption('上海办事处','上海办事处')); |
| | | // workLocationSelect.add(new SelectOption('江苏办事处','江苏办事处')); |
| | | // workLocationSelect.add(new SelectOption('江西办事处','江西办事处')); |
| | | // workLocationSelect.add(new SelectOption('浙江办事处','浙江办事处')); |
| | | // workLocationSelect.add(new SelectOption('安徽办事处','安徽办事处')); |
| | | // workLocationSelect.add(new SelectOption('福建办事处','福建办事处')); |
| | | // workLocationSelect.add(new SelectOption('广东办事处','广东办事处')); |
| | | // workLocationSelect.add(new SelectOption('深圳办事处','深圳办事处')); |
| | | // workLocationSelect.add(new SelectOption('湖北办事处','湖北办事处')); |
| | | // workLocationSelect.add(new SelectOption('湖南办事处','湖南办事处')); |
| | | // workLocationSelect.add(new SelectOption('云南办事处','云南办事处')); |
| | | // workLocationSelect.add(new SelectOption('贵州办事处','贵州办事处')); |
| | | // workLocationSelect.add(new SelectOption('四川办事处','四川办事处')); |
| | | // workLocationSelect.add(new SelectOption('重庆办事处','重庆办事处')); |
| | | // workLocationSelect.add(new SelectOption('杭州办事处','杭州办事处')); |
| | | // workLocationSelect.add(new SelectOption('杭州共通办事处','杭州共通办事处')); |
| | | // workLocationSelect.add(new SelectOption('西安办事处','西安办事处')); |
| | | // workLocationSelect.add(new SelectOption('西安共通办事处','西安共通办事处')); |
| | | // workLocationSelect.add(new SelectOption('共通办事处','共通办事处')); |
| | | // workLocationSelect.add(new SelectOption('成都办事处','成都办事处')); |
| | | // workLocationSelect.add(new SelectOption('成都共通办事处','成都共通办事处')); |
| | | // workLocationSelect.add(new SelectOption('广州办事处','广州办事处')); |
| | | // return workLocationSelect; |
| | | // } |
| | | |
| | | public PageReference RetrievalBtn() { |
| | | RepairList = new List<Repair__c>(); |
| | | RAInfoList = new List<RepairData>(); |
| | | if(String.isBlank(RevalInfo.Status1) && String.isBlank(RevalInfo.Status2) && String.isBlank(RevalInfo.RepairName) && String.isBlank(RevalInfo.SAPRepairNo) |
| | | && String.isBlank(RevalInfo.SerialNumber) && String.isBlank(RevalInfo.repair.Incharge_Staff__c) && String.isBlank(RevalInfo.onSiteRepair) |
| | | && String.isBlank(String.valueOf(RevalInfo.repair.Aware_date__c)) && String.isBlank(String.valueOf(RevalInfo.repair.Aware_date2__c)) && String.isBlank(RevalInfo.workLocationSelect) |
| | | && String.isBlank(RevalInfo.State_Hospital)){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '请至少添加一个检索条件!')); |
| | | return null; |
| | | } |
| | | String sql = 'select Id, Name, SAP_Service_Repair_No__c, Status1__c, Status2__c, Delivered_Product__c, SerialNumber__c, '; |
| | | sql += 'HP_Name__c, State_Hospital__c, Incharge_Staff__c, FSE_ApplyForRepair_Day__c, work_location_select__c, On_site_repair__c,'; |
| | | sql += 'Number_of_EffectiveContract__c, NewProductGuaranteeObject__c from Repair__c where Id != null '; |
| | | if(String.isNotBlank(RevalInfo.Status2)){ |
| | | sql += ' and Status2__c = \'' + RevalInfo.Status2 + '\''; |
| | | } |
| | | if(String.isNotBlank(RevalInfo.Status1)){ |
| | | sql += ' and Status1__c = \'' + RevalInfo.Status1 + '\''; |
| | | } |
| | | if(String.isNotBlank(RevalInfo.HospitalName)){ |
| | | |
| | | sql += ' and HP_Name__c like \'%' + RevalInfo.HospitalName.trim() + '%\''; |
| | | } |
| | | if(String.isNotBlank(RevalInfo.RepairName)){ |
| | | System.debug(LoggingLevel.INFO, '***RevalInfo.RepairName.contains(): ' + RevalInfo.RepairName.contains(' ')); |
| | | String splitStr = null; |
| | | if(RevalInfo.RepairName.contains(' ')){ |
| | | splitStr = ' '; |
| | | }else if(RevalInfo.RepairName.contains(',')){ |
| | | splitStr = ','; |
| | | } |
| | | if(splitStr != null && RevalInfo.RepairName.contains(splitStr)){ |
| | | sql += ' and ('; |
| | | list <String> nameList = RevalInfo.RepairName.split(splitStr); |
| | | for(String name: nameList){ |
| | | sql += 'Name like \'%' + name + '%\' or '; |
| | | } |
| | | sql = sql.removeEnd('or '); |
| | | sql += ')'; |
| | | }else{ |
| | | sql += ' and Name like \'%' + RevalInfo.RepairName.trim() + '%\''; |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** sql: ' + sql); |
| | | } |
| | | if(String.isNotBlank(RevalInfo.SAPRepairNo)){ |
| | | System.debug(LoggingLevel.INFO, '***RevalInfo.SAPRepairNo.contains(): ' + RevalInfo.SAPRepairNo.contains(' ')); |
| | | String splitStr = null; |
| | | if(RevalInfo.SAPRepairNo.contains(' ')){ |
| | | splitStr = ' '; |
| | | }else if(RevalInfo.SAPRepairNo.contains(',')){ |
| | | splitStr = ','; |
| | | } |
| | | if(splitStr != null && RevalInfo.SAPRepairNo.contains(splitStr)){ |
| | | sql += ' and ('; |
| | | |
| | | list <String> noList = RevalInfo.SAPRepairNo.split(splitStr); |
| | | for(String no: noList){ |
| | | sql += 'SAP_Service_Repair_No__c like \'%' + no + '%\' or '; |
| | | } |
| | | sql = sql.removeEnd('or '); |
| | | sql += ')'; |
| | | }else{ |
| | | sql += ' and SAP_Service_Repair_No__c like \'%' + RevalInfo.SAPRepairNo.trim() + '%\''; |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** sql: ' + sql); |
| | | } |
| | | if(String.isNotBlank(RevalInfo.SerialNumber)){ |
| | | List<String> SerialNumberList = new List<String>(); |
| | | if(RevalInfo.SerialNumber.indexOf(',') != -1){ |
| | | SerialNumberList = RevalInfo.SerialNumber.split(','); |
| | | } |
| | | System.debug('SerialNumberList1:' + SerialNumberList); |
| | | // 支持模糊查询多个,文本框输入用英文半角逗号分隔 |
| | | if(SerialNumberList.size() > 0){ |
| | | sql += ' and (SerialNumber__c like \'%'; |
| | | Integer i = 0; |
| | | for(String SerialNumber : SerialNumberList){ |
| | | if(i == 0){ |
| | | sql += SerialNumber.trim() + '%\''; |
| | | }else{ |
| | | sql += 'or SerialNumber__c like \'%' + SerialNumber.trim() + '%\''; |
| | | } |
| | | i++; |
| | | } |
| | | sql += ')'; |
| | | } else{ |
| | | sql += ' and SerialNumber__c like \'%' + RevalInfo.SerialNumber.trim() + '%\''; |
| | | } |
| | | } |
| | | if(String.isNotBlank(RevalInfo.repair.Incharge_Staff__c)){ |
| | | sql += ' and Incharge_Staff__c = \'' + RevalInfo.repair.Incharge_Staff__c + '\''; |
| | | } |
| | | if(String.isNotBlank(String.valueof(RevalInfo.repair.Aware_date__c))&&String.isNotBlank(String.valueof(RevalInfo.repair.Aware_date2__c))){ |
| | | String day = String.valueof(RevalInfo.repair.Aware_date__c); |
| | | String day2 = String.valueof(RevalInfo.repair.Aware_date2__c); |
| | | day = day.substring(0,10); |
| | | day2 = day2.substring(0,10); |
| | | sql += ' and FSE_ApplyForRepair_Day__c >= ' + day + 'and FSE_ApplyForRepair_Day__c <=' +day2; |
| | | } |
| | | if(String.isNotBlank(RevalInfo.onSiteRepair)){ |
| | | sql += ' and On_site_repair__c = \'' + RevalInfo.onSiteRepair + '\''; |
| | | } |
| | | if(String.isNotBlank(RevalInfo.workLocationSelect)){ |
| | | List<String> workLocationSelectList = new List<String>(); |
| | | if(RevalInfo.workLocationSelect.indexOf(',') != -1){ |
| | | workLocationSelectList = RevalInfo.workLocationSelect.split(','); |
| | | } |
| | | System.debug('workLocationSelectList1:' + workLocationSelectList); |
| | | if(workLocationSelectList.size() > 0){ |
| | | sql += ' and (work_location_select__c like \'%'; |
| | | Integer i = 0; |
| | | for(String workLocationSelect : workLocationSelectList){ |
| | | if(i == 0){ |
| | | sql += workLocationSelect.trim() + '%\''; |
| | | }else{ |
| | | sql += 'or work_location_select__c like \'%' + workLocationSelect.trim() + '%\''; |
| | | } |
| | | i++; |
| | | } |
| | | sql += ')'; |
| | | } else{ |
| | | sql += ' and work_location_select__c like \'%' + RevalInfo.workLocationSelect.trim() + '%\''; |
| | | } |
| | | } |
| | | if(String.isNotBlank(RevalInfo.State_Hospital)){ |
| | | sql += ' and State_Hospital__c like \'%' + RevalInfo.State_Hospital.trim() + '%\''; |
| | | } |
| | | sql += 'and Status1__c not in(\'0.删除\',\'0.取消\') limit 200'; |
| | | System.debug('sql1:' + sql); |
| | | if(String.isNotBlank(sql)){ |
| | | RepairList = Database.query(sql); |
| | | } |
| | | if(RepairList.size() == 200){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '检索数据太多,请缩小检索范围!')); |
| | | } |
| | | if(RepairList.size() <= 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '没检索到任何修理')); |
| | | return null; |
| | | } |
| | | for(Repair__c ra : RepairList){ |
| | | RepairData raData = new RepairData(ra); |
| | | RAInfoList.add(raData); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public PageReference showPDF() { |
| | | System.debug(LoggingLevel.INFO, '*** joinshoPDF: '); |
| | | repairIdList = new List<String>(); |
| | | RepairList = new List<Repair__c>(); |
| | | String url = '='; |
| | | System.debug('RAInfoList:' + RAInfoList); |
| | | if(RAInfoList == null || RAInfoList.isEmpty()){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '请先检索修理')); |
| | | return null; |
| | | } |
| | | for(RepairData rd : RAInfoList) { |
| | | System.debug(LoggingLevel.INFO, '*** rd: ' + rd); |
| | | if(rd.IFCheck){ |
| | | repairIdList.add(rd.repair.Id); |
| | | RepairList.add(rd.repair); |
| | | } |
| | | } |
| | | System.debug(LoggingLevel.INFO, '***repairIdList : ' + repairIdList); |
| | | System.debug(LoggingLevel.INFO, '***RepairList : ' + RepairList); |
| | | if(repairIdList.size() > 0){ |
| | | if(repairIdList.size() <= 50){ |
| | | if(RepairList.size() > 0){ |
| | | System.debug(LoggingLevel.INFO, '*** if size>0 generateAttachment: '); |
| | | generateAttachment(RepairList); |
| | | } |
| | | for(String Id : repairIdList){ |
| | | url += Id + '='; |
| | | } |
| | | url = url.substring(0, url.lastIndexOf('=')); |
| | | // PageReference pageRef = new PageReference('/apex/MaintenanceCommissionPDF?id' + url); |
| | | // pageRef.setRedirect(true); |
| | | // return pageRef; |
| | | if(isSandbox()){ |
| | | pdfURL = 'https://ocsm--stagefull--c.visualforce.com/apex/MaintenanceCommissionPDF?id' + url; |
| | | } else{ |
| | | pdfURL = 'https://ocsm.my.salesforce.com/apex/MaintenanceCommissionPDF?id' + url; |
| | | } |
| | | return null; |
| | | } else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '多单打印最大数量为50,请选择少于50个修理!')); |
| | | return null; |
| | | } |
| | | } else{ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '请至少选择一个修理')); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | // 生成pdf添加到对应的修理中 |
| | | public static PageReference generateAttachment(List<Repair__c> repList){ |
| | | System.debug(LoggingLevel.INFO, '*** generateAttachment: '); |
| | | // PageReference pdfPage; |
| | | // List<Attachment> attachments = new List<Attachment>(); |
| | | // List<String> attachmentNameList = new List<String>(); |
| | | // List<Attachment> isGeneratedPDFList = new List<Attachment>(); |
| | | // //删除已存在的附件,生成新的附件 |
| | | // for(Repair__c re : repList){ |
| | | // attachmentNameList.add(re.name + '_' + 'MaintenanceCommission.pdf'); |
| | | // } |
| | | // isGeneratedPDFList = [select id from Attachment where name IN:attachmentNameList]; |
| | | // System.debug(LoggingLevel.INFO, '*** isGeneratedPDFList: ' + isGeneratedPDFList); |
| | | // if(isGeneratedPDFList.size() > 0){ |
| | | // delete isGeneratedPDFList; |
| | | // } |
| | | BatchSelectRepairPDFDelete pdf = new BatchSelectRepairPDFDelete(); |
| | | pdf.deletePDF(repList); |
| | | pdf.createPDF(repList); |
| | | |
| | | // for(Repair__c re : repList){ |
| | | // pdfPage = new PageReference('/apex/MaintenanceCommissionPDF?id=' + re.Id); |
| | | // Blob pdfBody; |
| | | // if(Test.isRunningTest()) { |
| | | // pdfBody = blob.valueOf('Unit.Test'); |
| | | // } else { |
| | | // pdfBody = pdfPage.getContentAsPDF(); |
| | | // } |
| | | // Attachment attach = new Attachment(); |
| | | // attach.Body = pdfBody; |
| | | // attach.Name = re.name + '_' + 'MaintenanceCommission.pdf'; |
| | | // attach.ParentId = re.id; |
| | | // attachments.add(attach); |
| | | // } |
| | | // System.debug(LoggingLevel.INFO, '*** attachments: ' + attachments); |
| | | // insert attachments; |
| | | return null; |
| | | } |
| | | |
| | | // 判断是否是测试环境 |
| | | public Boolean isSandbox() { |
| | | return [SELECT IsSandbox FROM Organization LIMIT 1].IsSandbox; |
| | | } |
| | | |
| | | public class RetrievalData { |
| | | public String Status1{ get; set; } |
| | | public String Status2{ get; set; } |
| | | public String RepairName{ get; set; } |
| | | public String SAPRepairNo{ get; set; } |
| | | public String SerialNumber{ get; set; } |
| | | public String onSiteRepair{ get; set; } |
| | | public String workLocationSelect{ get; set; } |
| | | public String State_Hospital{ get; set; } |
| | | public String HospitalName{ get; set; } |
| | | public Repair__c repair{ get; set; } |
| | | public RetrievalData(){ |
| | | repair = new Repair__c(); |
| | | } |
| | | } |
| | | |
| | | public class RepairData { |
| | | public Boolean IFCheck { get; set; } |
| | | public Repair__c repair { get; set; } |
| | | public RepairData(Repair__c RepairInfo){ |
| | | IFCheck = null; |
| | | repair = RepairInfo; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class BatchSelectRepairPageControllerTest { |
| | | // static Repair__c repair02 |
| | | @TestSetup |
| | | public static void init(){ |
| | | |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert hpOwner; |
| | | List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_GI']; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'SoakupTestHp', OwnerId = hpOwner.Id); |
| | | insert hp; |
| | | Account dc = [select Id, Name, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_GI']; |
| | | Account dpt = new Account(RecordTypeId = rectDpt[0].Id); |
| | | dpt.Name = '*'; |
| | | dpt.Department_Name__c = 'TestDepart'; |
| | | dpt.ParentId = dc.Id; |
| | | dpt.Department_Class__c = dc.Id; |
| | | dpt.Hospital__c = hp.Id; |
| | | insert dpt; |
| | | Asset asset = new Asset(); |
| | | asset.Name = 'テスト機器'; |
| | | asset.AccountId = dpt.Id; |
| | | asset.Department_Class__c = dc.Id; |
| | | asset.Hospital__c = hp.Id; |
| | | asset.SerialNumber = 'testserial'; |
| | | insert asset; |
| | | |
| | | Repair__c repair01 = new Repair__c(); |
| | | repair01.Account__c = dpt.Id; |
| | | repair01.Department_Class__c = dc.Id; |
| | | repair01.Hospital__c = hp.Id; |
| | | repair01.Delivered_Product__c = asset.Id; |
| | | repair01.SERVICE_CONTRACT_JUDEGE_DAY__C = Date.today().addDays(0); |
| | | repair01.FSE_Work_Location__c = '上海'; |
| | | repair01.Service_Repair_No__c = 'SAP0001'; |
| | | repair01.Incharge_Staff__c = hpOwner.Id; |
| | | repair01.On_site_repair__c = 'RC修理'; |
| | | repair01.work_location_select__c = '北京办事处'; |
| | | // repair01.Final_complete_day__c = Date.today().addDays(-1); |
| | | insert repair01; |
| | | } |
| | | static testMethod void testSample_01() { |
| | | PageReference page = new PageReference('/apex/BatchSelectRepairPage'); |
| | | System.Test.setCurrentPage(page); |
| | | System.Test.StartTest(); |
| | | BatchSelectRepairPageController br = new BatchSelectRepairPageController(); |
| | | br.init(); |
| | | Repair__c repair01 = [SELECT Id,Status2__c,Name,Incharge_Staff__c,SAP_Service_Repair_No__c,Aware_date2__c,State_Hospital__c,SerialNumber__c,work_location_select__c,FSE_ApplyForRepair_Day__c,On_site_repair__c,Aware_date__c FROM Repair__c LIMIT 1]; |
| | | br.RevalInfo.repair = repair01; |
| | | br.RevalInfo.Status2 = repair01.Status2__c; |
| | | br.RevalInfo.RepairName = repair01.Name + ','; |
| | | br.RevalInfo.SerialNumber = repair01.SerialNumber__c + ',' + repair01.SerialNumber__c; |
| | | br.RevalInfo.SAPRepairNo = repair01.SAP_Service_Repair_No__c + ','; |
| | | // br.RevalInfo.repair.Aware_date__c = repair01.FSE_ApplyForRepair_Day__c.addDays(-1); |
| | | // br.RevalInfo.repair.Aware_date2__c = repair01.FSE_ApplyForRepair_Day__c.addDays(1); |
| | | br.RevalInfo.onSiteRepair = repair01.On_site_repair__c; |
| | | br.RevalInfo.workLocationSelect = repair01.work_location_select__c; |
| | | br.RevalInfo.State_Hospital = repair01.State_Hospital__c; |
| | | br.RetrievalBtn(); |
| | | BatchSelectRepairPageController.RepairData reparedata = new BatchSelectRepairPageController.RepairData(repair01); |
| | | reparedata.IFCheck = true; |
| | | br.RAInfoList.add(reparedata); |
| | | br.RAInfoList[0].IFCheck = true; |
| | | system.assertEquals(br.RAInfoList[0].IFCheck,true); |
| | | br.showPDF(); |
| | | List<Repair__c> repList = new List<Repair__c>(); |
| | | repList.add(repair01); |
| | | BatchSelectRepairPageController.generateAttachment(repList); |
| | | System.Test.StopTest(); |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, List<sObject> scope) { |
| | | // SWAG-CE55BX 预测优化 start |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | // SWAG-CE55BX 预测优化 end |
| | | List<Opportunity> oppUpdateList = new List<Opportunity>(); |
| | | List<Opportunity> updateList = [select id,Inquiry_forcast_date_formular__c,Inquiry_forcast_date_copy__c |
| | | ,OCM_man_province_cus__c,OCM_man_province_cus_txt__c |
| | |
| | | @isTest |
| | | private class BeforeUpsertReportHandlerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Rental_Apply__c'); |
| | | } |
| | | static testMethod void testMethod1() { |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | |
| | |
| | | oPDPlan0.NoOpp_Reason__c = 'HCP对应'; |
| | | oPDPlan0.Related_Opportunity1_ID__c =opp1.id; |
| | | oPDPlan0.Account_Laboratory__c =dep.Id; |
| | | oPDPlan0.OPDType__c = '事件'; |
| | | insert oPDPlan0; |
| | | |
| | | |
| | |
| | | oPDPlan0.Status__c = '草案中'; |
| | | oPDPlan0.OPDPlan_ImplementDate__c = Date.today().addDays(1); |
| | | oPDPlan0.NoOpp_Reason__c = 'HCP对应'; |
| | | oPDPlan0.OPDType__c = '事件'; |
| | | insert oPDPlan0; |
| | | |
| | | // 产品 |
| New file |
| | |
| | | /** |
| | | * 20220606 lt 带量采购记录 |
| | | * 根据“产品编号”检索产品主数据,给字段“产品”(查找产品)赋值 |
| | | */ |
| | | public without sharing class BringQuantityHandler extends Oly_TriggerHandler{ |
| | | private Map<Id, BringQuantityPurchaseRecord__c> newMap; |
| | | private Map<Id, BringQuantityPurchaseRecord__c> oldMap; |
| | | private List<BringQuantityPurchaseRecord__c> newList; |
| | | private List<BringQuantityPurchaseRecord__c> oldList; |
| | | |
| | | public BringQuantityHandler() { |
| | | this.newMap = (Map<Id, BringQuantityPurchaseRecord__c>) Trigger.newMap; |
| | | this.oldMap = (Map<Id, BringQuantityPurchaseRecord__c>) Trigger.oldMap; |
| | | this.newList = (List<BringQuantityPurchaseRecord__c>) Trigger.new; |
| | | this.oldList = (List<BringQuantityPurchaseRecord__c>) Trigger.old; |
| | | } |
| | | |
| | | protected override void beforeInsert(){ |
| | | specialCharacterClear(); |
| | | FindProducts(); |
| | | } |
| | | |
| | | protected override void beforeUpdate(){ |
| | | specialCharacterClear(); |
| | | FindProducts(); |
| | | } |
| | | |
| | | // 把型号、型号确认、规格里的”改成" |
| | | private void specialCharacterClear() { |
| | | for(BringQuantityPurchaseRecord__c bqp : newList){ |
| | | // 型号 |
| | | bqp.Model__c = String.isNotBlank(bqp.Model__c) && bqp.Model__c.contains('”') ? bqp.Model__c.replaceAll('”','"') : bqp.Model__c; |
| | | // 型号确认 |
| | | bqp.ModelConfirm__c = String.isNotBlank(bqp.ModelConfirm__c) && bqp.ModelConfirm__c.contains('”') ? bqp.ModelConfirm__c.replaceAll('”','"') : bqp.ModelConfirm__c; |
| | | // 规格 |
| | | bqp.Specifications__c = String.isNotBlank(bqp.Specifications__c) && bqp.Specifications__c.contains('”') ? bqp.Specifications__c.replaceAll('”','"') : bqp.Specifications__c; |
| | | } |
| | | } |
| | | |
| | | private void FindProducts(){ |
| | | if(trigger.isInsert || trigger.isUpdate){ |
| | | //存带量采购的产品编号 |
| | | List<String> bqList = new List<String>(); |
| | | List<String> MDMList = new List<String>(); |
| | | for(BringQuantityPurchaseRecord__c bqp : newList){ |
| | | // if(bqp.ProductNumber__c != null){ |
| | | if(String.isNotBlank(bqp.ProductNumber__c)){ |
| | | bqList.add(bqp.ProductNumber__c); |
| | | } |
| | | if (String.isNotBlank(bqp.ModelConfirm__c)) { |
| | | MDMList.add(bqp.ModelConfirm__c); |
| | | } |
| | | } |
| | | |
| | | //根据产品编号查产品 |
| | | List<Product2> proList = [select id, Name, ProductCode, MDM_Model_No__c from Product2 where ProductCode in :bqList or MDM_Model_No__c in :MDMList]; |
| | | |
| | | for(BringQuantityPurchaseRecord__c bqr : newList){ |
| | | for(Product2 pro : proList){ |
| | | if((bqr.ProductNumber__c == pro.ProductCode) || (bqr.ModelConfirm__c == pro.MDM_Model_No__c)){ |
| | | bqr.Product2__c = pro.id; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class BringQuantityHandlerTest{ |
| | | |
| | | static testMethod void initTest() { |
| | | |
| | | Product2 pro1 = new Product2( |
| | | Name='name01', |
| | | IsActive=true, |
| | | Asset_Model_No__c='n01', |
| | | MDM_Model_No__c='n01', |
| | | ProductCode_Ext__c='pc01', |
| | | ProductCode = 'pc01', |
| | | Manual_Entry__c=false, |
| | | SFDA_Status__c='有効' |
| | | ); |
| | | insert pro1; |
| | | |
| | | Product2 pro2 = new Product2( |
| | | Name='name02', |
| | | IsActive=true, |
| | | Asset_Model_No__c='n02', |
| | | MDM_Model_No__c='n02', |
| | | ProductCode_Ext__c='pc02', |
| | | ProductCode = 'pc02', |
| | | Manual_Entry__c=false, |
| | | SFDA_Status__c='有効' |
| | | ); |
| | | insert pro2; |
| | | |
| | | BringQuantityPurchaseRecord__c bqp = new BringQuantityPurchaseRecord__c(); |
| | | bqp.ProductNumber__c = 'pc01'; |
| | | insert bqp; |
| | | |
| | | bqp.ProductNumber__c = 'pc02'; |
| | | update bqp; |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public String contactsInfo {set;get;} |
| | | public String awsDataIdArray {set;get;} |
| | | |
| | | public String sfContactId{set;get;} //zhj 2022-12-02 sfId |
| | | |
| | | public CM_SearchContact() { |
| | | openLine = Apexpages.currentPage().getParameters().get('line'); |
| | | accountId = Apexpages.currentPage().getParameters().get('acc'); |
| | |
| | | newCon = new Contact(); |
| | | newCon.AccountId = accountId; |
| | | |
| | | sfContactId = ''; //zhj 2022-12-02 sfId |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | public PageReference editContact() { |
| | | if (conId != null && conId != '') { |
| | | newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c, |
| | | // newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c, |
| | | // FirstName, LastName,AWS_Data_Id__c |
| | | // from Contact where Id = :conId]; |
| | | newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c, |
| | | FirstName, LastName,AWS_Data_Id__c |
| | | from Contact where Id = :conId]; |
| | | from Contact where Id = :conId]; //zhj 新方案改造 去除Encrypted__c 2022-12-05 |
| | | newCon.Search_LastName__c = newCon.LastName; |
| | | newCon.Search_FirstName__c = newCon.FirstName; |
| | | |
| | | sfContactId = newCon.Id; // zhj 2022-12-02 得到sfid给aws |
| | | } |
| | | |
| | | return null; |
| | |
| | | newCon.FirstName = newCon.Search_FirstName__c; |
| | | upsert newCon; |
| | | |
| | | sfContactId = newCon.Id; // zhj 2022-12-02 得到sfid给aws |
| | | |
| | | searchCon.Search_LastName__c = newCon.LastName; |
| | | searchCon.Search_FirstName__c = newCon.FirstName; |
| | | searchContact(); |
| | |
| | | public String conId { get; set; } |
| | | |
| | | public String openLine { get; set; } |
| | | public String accountIdV2{ get; set; } //zhj 2022-02-04 新方案改造 |
| | | private String accountId; |
| | | private String nowValue; |
| | | |
| | |
| | | public String contactsInfo {set;get;} |
| | | public String awsDataIdArray {set;get;} |
| | | |
| | | public String sfContactId{set;get;} //zhj 2022-12-02 sfId |
| | | public String staticResourceContactV2 {get; set;} //zhj 2022-02-04 新方案改造 |
| | | |
| | | public CM_SearchContactServiceController() { |
| | | openLine = Apexpages.currentPage().getParameters().get('line'); |
| | | accountId = Apexpages.currentPage().getParameters().get('acc'); |
| | | accountIdV2 = accountId; |
| | | nowValue = Apexpages.currentPage().getParameters().get('now'); |
| | | |
| | | //2022/02/15 张华建 PI PL start |
| | |
| | | contactsInfo = JSON.serialize(awsIdToContactMap); |
| | | contactAWSIds = JSON.serialize(conAWSIds); |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact')); |
| | | staticResourceContactV2 = JSON.serialize(PIHelper.getPIIntegrationInfo('ContactV2')); //zhj 2022-02-04 新方案改造 |
| | | //2022/02/15 张华建 PI PL end |
| | | } |
| | | |
| | |
| | | |
| | | newCon = new Contact(); |
| | | newCon.AccountId = accountId; |
| | | sfContactId = ''; |
| | | |
| | | return; |
| | | } |
| | |
| | | |
| | | public PageReference editContact() { |
| | | if (conId != null && conId != '') { |
| | | newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c, |
| | | // newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c, |
| | | // FirstName, LastName,AWS_Data_Id__c |
| | | // from Contact where Id = :conId]; |
| | | newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c, |
| | | FirstName, LastName,AWS_Data_Id__c |
| | | from Contact where Id = :conId]; |
| | | from Contact where Id = :conId]; //zhj 新方案改造 去除Encrypted__c 2022-12-05 |
| | | newCon.Search_LastName__c = newCon.LastName; |
| | | newCon.Search_FirstName__c = newCon.FirstName; |
| | | sfContactId = newCon.Id; // zhj 2022-12-02 得到sfid给aws |
| | | } |
| | | |
| | | return null; |
| | |
| | | newCon.LastName = newCon.Search_LastName__c; |
| | | newCon.FirstName = newCon.Search_FirstName__c; |
| | | upsert newCon; |
| | | System.debug('newCon.Id = ' + newCon.Id); |
| | | sfContactId = newCon.Id; // zhj 2022-12-02 得到sfid给aws |
| | | |
| | | searchCon.Search_LastName__c = newCon.LastName; |
| | | searchCon.Search_FirstName__c = newCon.FirstName; |
| | |
| | | public PageReference editClear() { |
| | | newCon = new Contact(); |
| | | newCon.AccountId = accountId; |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | con = in_con; |
| | | } |
| | | } |
| | | |
| | | //zhj MEBG新方案改造 2022-11-24 start |
| | | @RemoteAction |
| | | public static ResponseV2 searchContactByAccountId(String accountId) { |
| | | System.debug('accountId = ' + accountId); |
| | | ResponseV2 res = new ResponseV2(); |
| | | try{ |
| | | Account account = [select Id,Name from Account where Id = :accountId]; |
| | | List<Contact> contactList = [select id,AWS_Data_Id__c, CManageCode__c,Name from Contact where AccountId = :account.Id]; |
| | | Map<String,String> dataIdManageCodeMap = new Map<String,String>(); |
| | | for(Contact contact : contactList){ |
| | | dataIdManageCodeMap.put(contact.AWS_Data_Id__c,contact.CManageCode__c); |
| | | } |
| | | res.dataIdManageCodeMap = dataIdManageCodeMap; |
| | | res.accountName = account.Name; |
| | | res.contactList = contactList; |
| | | |
| | | Map<String,String> accMap= new Map<String,String>(); |
| | | List<Account> accList=[select ID,Is_Active__c,Is_Active_Formula__c from Account where ID =:accountId]; |
| | | if(accList.size()>0){ |
| | | for(Account acc:accList){ |
| | | if (String.isNotBlank(acc.Is_Active__c)){ |
| | | String subId = acc.Id; |
| | | accMap.put(subId.substring(0,15), acc.Is_Active__c); |
| | | continue; |
| | | } |
| | | if (String.isNotBlank(acc.Is_Active_Formula__c)){ |
| | | String subId = acc.Id; |
| | | accMap.put(subId.substring(0,15), acc.Is_Active_Formula__c); |
| | | } |
| | | } |
| | | } |
| | | System.debug('accMap= ' + accMap); |
| | | res.isNameMobileVerif = true; |
| | | res.isMobileVerif = false; |
| | | res.status = 'success'; |
| | | return res; |
| | | }catch(Exception e){ |
| | | res.message = e.getMessage() + ''; |
| | | res.status = 'fail'; |
| | | return res; |
| | | } |
| | | } |
| | | |
| | | public class ResponseV2{ |
| | | public List<Contact> contactList{set;get;} |
| | | public String accountName{set;get;} |
| | | public Map<String,String> dataIdManageCodeMap{set;get;} |
| | | public Boolean isMobileVerif; |
| | | public Boolean isNameMobileVerif; |
| | | public String message{set;get;} |
| | | public String status{set;get;} |
| | | } |
| | | //zhj MEBG新方案改造 2022-11-24 end |
| | | } |
| | |
| | | private class CM_SearchContactServiceControllerTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(new String[]{'Contact','Agency_Contact__c','contactV2'}); |
| | | } |
| | | |
| | | @isTest static void test_method_one() { |
| | |
| | | cmsc.saveNew(); |
| | | |
| | | cmsc.editClear(); |
| | | CM_SearchContactServiceController.searchContactByAccountId(depart1.Id); |
| | | } |
| | | |
| | | } |
| | |
| | | private class CM_SearchContactTest { |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(new String[]{'Contact','Agency_Contact__c'}); |
| | | } |
| | | @isTest static void test_method_one() { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | |
| | | // 学会会议的出借备品信息-->OPD计划出借备品信息 |
| | | tempOPD.PlanProdDetail__c = c.LoadNum__c; |
| | | tempOPD.OPDType__c = '学会';//2020-10-21 zh OPD计划类型为学会 SWAG-BS6BYA |
| | | tempOPD.RentalReson__c = '演示';// 20220804 ljh SWAG-CGG7X9 默认 演示 |
| | | //20201118 you SWAG-BVGAGD start |
| | | tempOPD.Meeting_Cooperate__c = c.Meeting_Cooperate__c; |
| | | tempOPD.Meeting_Cooperate2__c = c.Meeting_Cooperate2__c; |
| | |
| | | // public List<AdjudicationData> AdjudicationDataList{ get; set; } |
| | | public AdjudicationData AdjudicationDataobj{ get; set; } |
| | | public boolean hasError { get; set; } |
| | | public String MeetingApprovedName{ get; set; } |
| | | // public String MeetingApprovedName{ get; set; } |
| | | public String flag{ get; set; } |
| | | public String CampaignTheme{ get; set; } |
| | | private String RecordTypeId{ get; set; } |
| | |
| | | MeetingApprovedIdList.add(AdjudicationDataobj.cam.Meeting_Approved_No__c); |
| | | } |
| | | List<Application_for_Conference_Adjudication__c> MeetingApprovedList = |
| | | [select Id, Name, StartDate__c, EndDate__c, BudgetType__c, OfficeCategory__c, MeetingType__c, WorkshopPlace__c, |
| | | [select Id, Name, StartDate__c, EndDate__c, Implementation_Purpose1__c, OfficeCategory__c, MeetingType__c, WorkshopPlace__c, |
| | | HostName__c, CooperatorCompany__c, ConveningParticipantsNum__c, ExpectedOlympusAttendance__c,ExpectedHcpAttendance__c, |
| | | SponsorshipCategory__c, IsPaidToSponsor__c, ActivityTypeName__c, Type_of_adjudication_meeting__c |
| | | from Application_for_Conference_Adjudication__c where Id = :MeetingApprovedIdList]; |
| | |
| | | if(String.isNotBlank(String.valueOf(mam.EndDate__c))){ |
| | | url += '&cpn6=' + String.valueOf(mam.EndDate__c).replace('-','/'); |
| | | } |
| | | if(String.isNotBlank(mam.BudgetType__c)){ |
| | | url += '&00N100000098OEy=' + mam.BudgetType__c; |
| | | if(String.isNotBlank(mam.Implementation_Purpose1__c)){ |
| | | url += '&00N100000098OEy=' + mam.Implementation_Purpose1__c; |
| | | } |
| | | if(String.isNotBlank(mam.OfficeCategory__c)){ |
| | | url += '&00N10000006pwAg=' + mam.OfficeCategory__c; |
| | |
| | | afca.Name = 'test01'; |
| | | afca.StartDate__c = Date.today(); |
| | | afca.EndDate__c = Date.today().addDays(20); |
| | | afca.BudgetType__c = '新产品上市'; |
| | | afca.Implementation_Purpose1__c = '新产品上市'; |
| | | afca.OfficeCategory__c = '1.消化科'; |
| | | afca.MeetingType__c = '共同主办会'; |
| | | afca.WorkshopPlace__c = 'Beijing'; |
| | |
| | | // afca.Name = 'test01'; |
| | | // afca.StartDate__c = Date.today(); |
| | | // afca.EndDate__c = Date.today().addDays(20); |
| | | // afca.BudgetType__c = '新产品上市'; |
| | | // afca.Implementation_Purpose1__c = '新产品上市'; |
| | | // afca.OfficeCategory__c = '1.消化科'; |
| | | // afca.MeetingType__c = '共同主办会'; |
| | | // afca.WorkshopPlace__c = 'Beijing'; |
| | |
| | | public static Campaign createCampaignData( String inputName) { |
| | | Campaign ret = new Campaign(); |
| | | ret.Name = inputName; |
| | | ret.HostName__c = '会议主办方'; |
| | | ret.cooperatorCompany__c = '会议承办方'; |
| | | return ret; |
| | | } |
| | | |
| | |
| | | ProcessState__c, |
| | | StartDate__c, |
| | | EndDate__c, |
| | | BudgetType__c, |
| | | Implementation_Purpose1__c, |
| | | OfficeCategory__c, |
| | | MeetingType__c, |
| | | ActivityTypeName__c, |
| | |
| | | cam.MeetingApprovedNo__c = app.MeetingApprovedNo__c; |
| | | // 非赞助会的情况下更新以下内容 |
| | | if (app.MeetingType__c != '赞助会') { |
| | | cam.StartDate = app.StartDate__c; |
| | | cam.EndDate = app.EndDate__c; |
| | | cam.Budget_Type__c = app.BudgetType__c; |
| | | //20221206 lt DB202212060256 start |
| | | // System.debug('lt123-------Cam------记录类型----'+cam.RecordTypeId); |
| | | // System.debug('lt123-------Cam------会议类型----'+cam.Meeting_Type__c); |
| | | if(cam.RecordTypeId == '01210000000QfeD' || cam.RecordTypeId == '01210000000gQzO'){ |
| | | // System.debug('lt123-------Cam------1----'); |
| | | if (cam.Meeting_Type__c != '主办会'){ |
| | | // System.debug('lt123-------Cam------2----'); |
| | | cam.StartDate = app.StartDate__c; |
| | | cam.EndDate = app.EndDate__c; |
| | | } |
| | | } |
| | | if(cam.RecordTypeId != '01210000000QfeD' && cam.RecordTypeId != '01210000000gQzO'){ |
| | | // System.debug('lt123-------Cam------3----'); |
| | | cam.StartDate = app.StartDate__c; |
| | | cam.EndDate = app.EndDate__c; |
| | | } |
| | | // cam.StartDate = app.StartDate__c; |
| | | // cam.EndDate = app.EndDate__c; |
| | | //20221206 lt DB202212060256 end |
| | | cam.Implementation_Purpose__c = app.Implementation_Purpose1__c; |
| | | cam.OfficeCategory__c = app.OfficeCategory__c; |
| | | cam.Meeting_Type__c = app.MeetingType__c; |
| | | |
| | | cam.WorkshopPlace__c = app.WorkshopPlace__c; |
| | | cam.WorkshopPlace__c = String.isNotBlank(app.WorkshopPlace__c) ? app.WorkshopPlace__c : cam.WorkshopPlace__c; |
| | | cam.HostName__c = app.HostName__c; |
| | | cam.cooperatorCompany__c = app.CooperatorCompany__c; |
| | | cam.Convening_Participants_Num__c = app.ConveningParticipantsNum__c; |
| | |
| | | // cam.Activity_Type_Name__c = app.ActivityTypeName__c; |
| | | cam.Activity_Type_Name__c = app.Type_of_adjudication_meeting__c; |
| | | // 这里需要额外加操作 |
| | | cam.State_Master__c = StateCityUtil.get_state(app.StateMaster__c); |
| | | cam.City_Master__c = StateCityUtil.get_city(app.CityMaster__c); |
| | | cam.State_Master__c = String.isNotBlank(app.StateMaster__c) ? StateCityUtil.get_state(app.StateMaster__c) : cam.State_Master__c; |
| | | cam.City_Master__c = String.isNotBlank(app.CityMaster__c) ? StateCityUtil.get_city(app.CityMaster__c) : cam.City_Master__c; |
| | | |
| | | if (cam.Num__c != app.Num__c) { |
| | | app.Num__c = cam.Num__c; |
| | |
| | | static testMethod void testMethod2(){ |
| | | StaticParameter.EscapeCampain =false; |
| | | StaticParameter.shareToOSCMFlag = false; |
| | | |
| | | Application_for_Conference_Adjudication__c afc = new Application_for_Conference_Adjudication__c(); |
| | | afc.Name = 'test01'; |
| | | afc.StartDate__c = Date.today().addDays(1); |
| | | afc.EndDate__c = Date.today().addDays(21); |
| | | insert afc; |
| | | |
| | | Application_for_Conference_Adjudication__c afca = new Application_for_Conference_Adjudication__c(); |
| | | afca.Name = 'test02'; |
| | | afca.StartDate__c = Date.today(); |
| | | afca.EndDate__c = Date.today().addDays(20); |
| | | // afca.Implementation_Purpose1__c = '新产品上市'; |
| | | // afca.OfficeCategory__c = '1.消化科'; |
| | | // afca.MeetingType__c = '共同主办会'; |
| | | // afca.WorkshopPlace__c = 'Beijing'; |
| | | // afca.HostName__c = 'Olympus'; |
| | | // afca.CooperatorCompany__c = 'Olympus'; |
| | | // afca.ConveningParticipantsNum__c = 200; |
| | | // afca.ExpectedOlympusAttendance__c = 200; |
| | | // afca.ExpectedHcpAttendance__c = 200; |
| | | // afca.SponsorshipCategory__c = '无'; |
| | | // afca.IsPaidToSponsor__c = '是'; |
| | | // afca.ActivityTypeName__c = '线上'; |
| | | insert afca; |
| | | |
| | | // Implement test code |
| | | Campaign cam = new Campaign(); |
| | | cam.Name = 'test campaign'; |
| | |
| | | cam.Mailflg_after3__c = true; |
| | | cam.HostName__c = '1'; |
| | | cam.cooperatorCompany__c = '1'; |
| | | cam.Meeting_Approved_No__c = afc.Id; |
| | | cam.RecordTypeId = System.label.RecordType_CampaignService; |
| | | insert cam; |
| | | StaticParameter.EscapeCampain =false; |
| | | cam.Status = '时间修改申请中'; |
| | | cam.is_true_or_false__c = true; |
| | | cam.is_pass_or_fail__c = 1; |
| | | cam.Meeting_Approved_No__c = afca.Id; |
| | | update cam; |
| | | } |
| | | static testMethod void testMethod3(){ |
| | |
| | | // SWAG-BUF6J5 20201111 you start |
| | | if (cancelIdSet.size() > 0) {//查询opd计划下得所有备品借出申请 更新 状态 |
| | | List<Rental_Apply__c> Rentals = new List<Rental_Apply__c>(); |
| | | List<Rental_Apply__c> RentalList = [select id,Cancel_Reason__c , Loaner_cancel_request__c,OPDPlan__c from Rental_Apply__c where OPDPlan__c in: cancelIdSet and Status__c <> '取消']; |
| | | // 20230222 ljh DB202301265636 start |
| | | // 20230202 ljh DB202301265636 start |
| | | // List<Rental_Apply__c> RentalList = [select id,Cancel_Reason__c , Loaner_cancel_request__c,OPDPlan__c from Rental_Apply__c where OPDPlan__c in: cancelIdSet and Status__c <> '取消']; |
| | | List<Rental_Apply__c> RentalList = [select id,Cancel_Reason__c , Loaner_cancel_request__c,OPDPlan__c from Rental_Apply__c where OPDPlan__c in: cancelIdSet and Status__c <> '取消' AND Shipment_request_Cnt__c = 0]; |
| | | // 20230202 ljh DB202301265636 end |
| | | // 学会取消批准的时候 发邮件 不上线了 |
| | | // List<Rental_Apply__c> RentalList = new List<Rental_Apply__c>(); |
| | | // List<Rental_Apply__c> RentalCancleAlertList = new List<Rental_Apply__c>(); |
| | | // List<Rental_Apply__c> RentalListTemp = [select id,Cancel_Reason__c , Loaner_cancel_request__c,OPDPlan__c,Shipment_request_Cnt__c from Rental_Apply__c where OPDPlan__c in: cancelIdSet and Status__c <> '取消']; |
| | | // for(Rental_Apply__c ra:RentalListTemp){ |
| | | // if(ra.Shipment_request_Cnt__c == 0){ |
| | | // RentalList.add(ra); |
| | | // }else{ |
| | | // ra.CancelDay__c = Date.today(); |
| | | // RentalCancleAlertList.add(ra); |
| | | // } |
| | | // } |
| | | // 20230222 ljh DB202301265636 end |
| | | Set<String> cancelIdSet1 = new Set<String>(); //手动调回审批 |
| | | SS_Batch_Column_Mapping__c mpdMapping = SS_Batch_Column_Mapping__c.getValues('Rental_Apply_OPD_Cancle'); |
| | | //2021/02/07 liying SWAG-BXVDPJ start |
| | |
| | | } |
| | | } |
| | | if (cancelIdSet1.size() > 0) { |
| | | List<Approval.ProcessWorkitemRequest> requests = new List<Approval.ProcessWorkitemRequest> (); |
| | | Map<ID,ProcessInstance> piMap = New Map<ID,ProcessInstance>([Select Id from ProcessInstance where TargetObjectId IN :cancelIdSet1]); |
| | | system.debug('==cancelIdSet1=='+cancelIdSet1); |
| | | for(ProcessInstanceWorkItem wi : [Select Id from ProcessInstanceWorkItem where ProcessInstanceId IN :piMap.keySet()]){ |
| | | Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest(); |
| | | req2.setAction('Removed'); |
| | | req2.setWorkitemId(wi.Id); |
| | | requests.add(req2); |
| | | List<Approval.ProcessWorkitemRequest> requests = new List<Approval.ProcessWorkitemRequest> (); |
| | | Map<ID,ProcessInstance> piMap = New Map<ID,ProcessInstance>([Select Id from ProcessInstance where TargetObjectId IN :cancelIdSet1]); |
| | | system.debug('==cancelIdSet1=='+cancelIdSet1); |
| | | for(ProcessInstanceWorkItem wi : [Select Id from ProcessInstanceWorkItem where ProcessInstanceId IN :piMap.keySet()]){ |
| | | Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest(); |
| | | req2.setAction('Removed'); |
| | | req2.setWorkitemId(wi.Id); |
| | | requests.add(req2); |
| | | } |
| | | system.debug('==requests.size()=='+requests.size()); |
| | | if (requests.size() > 0) { |
| | | Approval.ProcessResult[] processResults = null; |
| | | processResults = Approval.process(requests, true); |
| | | system.debug('==调回审批得结果=='+processResults); |
| | | } |
| | | } |
| | | system.debug('==requests.size()=='+requests.size()); |
| | | if (requests.size() > 0) { |
| | | Approval.ProcessResult[] processResults = null; |
| | | processResults = Approval.process(requests, true); |
| | | system.debug('==调回审批得结果=='+processResults); |
| | | if(Rentals.size()>0){ |
| | | update Rentals; |
| | | } |
| | | } |
| | | if(Rentals.size()>0){ |
| | | update Rentals; |
| | | } |
| | | // 20230222 ljh DB202301265636 start |
| | | // 学会取消批准的时候 发邮件 不上线了 |
| | | // if(RentalCancleAlertList.size() > 0 ){ |
| | | // update RentalCancleAlertList; |
| | | // } |
| | | // 20230222 ljh DB202301265636 end |
| | | } |
| | | // SWAG-BUF6J5 20201111 you end |
| | | //2021-08-11 mzy SWAG-C5RAZV 事件——计划 延期 调查 start |
| | |
| | | private class CaseHpDeptUpdTriggerTest { |
| | | |
| | | static testMethod void myUnitTest() { |
| | | Oly_TriggerHandler.bypass('ContactTriggerHandler'); |
| | | // レコードタイプ取得 |
| | | RecordType hospitalRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | RecordType sectionRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 消化科']; |
| | |
| | | //1.只查找100条保有设备数据 |
| | | String fuselageNumberTrim = String.isNotBlank(FuselageNumber)?FuselageNumber.trim():''; |
| | | String serialNumber = '%' + String.escapeSingleQuotes(fuselageNumberTrim.replaceAll('%', '\\%')) + '%'; |
| | | List < Asset > assetListed = [SELECT Id,name,SerialNumber,InstallDate,Information_From__c,Asset_situation__c, |
| | | List < Asset > assetListed = [SELECT Id,name,SerialNumber,InstallDate, |
| | | // Information_From__c,// 20220927 ljh XLIU-CJN62G |
| | | Asset_situation__c, |
| | | Order_No__c,Account.Name,Status,Department_Class__c,Hospital__r.Owner.Name, |
| | | Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c, |
| | | Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name , |
| | | Department_Class__r.Id,Ji_Zhong_Guan_Li_Ku_Cun__c,Account.RecordTypeId |
| | | Department_Class__r.Id, |
| | | // Ji_Zhong_Guan_Li_Ku_Cun__c,// 20220927 ljh XLIU-CJN62G |
| | | Posting_Date__c,Extend_Gurantee_DateTo__c,CurrentContract_End_Date__c,// 20220927 ljh XLIU-CJN62G |
| | | Account.RecordTypeId |
| | | ,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c |
| | | ,Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start |
| | | ,NoPartRiskDate_F__c |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end |
| | | FROM Asset where Id != null AND Repairing_Count__c >= 0 AND SerialNumber like :serialNumber LIMIT 100 |
| | | |
| | | ]; |
| | |
| | | for (Asset ast: assetListed) { |
| | | choiceAssetInfoRecordsview.add(new ChoiceAssetInfo(ast)); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 检索 |
| | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '只能选择一个保有设备')); |
| | | return null; |
| | | } |
| | | |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start |
| | | List<Asset> ass = [select id,Product_ID__c from Asset where ID = :ast.Id]; |
| | | List<Product2> p2 = [select id,Name,Can_Repair__c |
| | | from Product2 where |
| | | ID = :ass[0].Product_ID__c]; |
| | | String canRepair = p2[0].Can_Repair__c; |
| | | if (canRepair=='第三方'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '非我司修理对象,无法新建修理,如有不明请咨询CIC')); |
| | | return null; |
| | | } |
| | | if (canRepair=='不' || String.isBlank(canRepair)){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '本设备无法新建修理')); |
| | | return null; |
| | | } |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end |
| | | return createData(ast); |
| | | } |
| | | |
| | | |
| | | public PageReference createData(Asset ast) { |
| | | String url = '/'; |
| | | String joint_1 = '='; |
| | | String joint_2 = '_lkid='; |
| | | String joint_3 = '&CF'; |
| | | String joint_4 = '&'; |
| | | |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | List<Asset> ass = [select id,Product_ID__c from Asset where ID = :ast.Id]; |
| | | List<Product2> p2 = [select id,Name,Can_Repair__c |
| | | from Product2 where |
| | | ID = :ass[0].Product_ID__c]; |
| | | String canRepair = p2[0].Can_Repair__c; |
| | | system.debug('1111111111111111111'+canRepair); |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | if ('Repair'.equals(dataType)) { |
| | | String Delivered_Product_Id = '00N10000002Dx1X'; //设备型号 |
| | | String Account_Id = '00N10000002Dx5n'; //科室 |
| | |
| | | String ActualVisitDateThird_Id= '';//三次上门日 |
| | | String SubOrderCompleteDate_Id= '';//报修单处理完成日 |
| | | String SubOrderCreatedDate_Id= '';//报修单申请修理日 |
| | | //LLIU-CGX5E9 LY 20220812 start |
| | | String DateReceiptQuestions_Id = '';//问题联络收到日 |
| | | //LLIU-CGX5E9 LY 20220812 end |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | String Excwork_location_Id = '';//跳过维修中心 |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | String engineerSendDate_Id= '';//工程师修理品寄送日 |
| | | if (NFMUtil.isSandbox()) { //测试环境 |
| | | RepairApplicant_Id = '00N1m0000054ufW'; //报修人 |
| | | // RepairApplicantPosition_Id = '00N1m0000054ufV'; //报修人岗位 |
| | | RepairApplicantHospital_Id = '00N1m0000054ufU'; //报修人医院 |
| | | RepairApplicantDepartment_Id = '00N1m0000054ufT'; //报修人科室 |
| | | baoxiuzidan = '00N1m0000054ufZ'; //报修子单 |
| | | faqiri = '00N1m0000054ufa'; //报修发起日 |
| | | shouliri = '00N1m0000054ufS'; //工程师受理日 |
| | | // if (NFMUtil.isSandbox()) { //测试环境 |
| | | // RepairApplicant_Id = '00N1m0000054ufW'; //报修人 |
| | | // // RepairApplicantPosition_Id = '00N1m0000054ufV'; //报修人岗位 |
| | | // RepairApplicantHospital_Id = '00N1m0000054ufU'; //报修人医院 |
| | | // RepairApplicantDepartment_Id = '00N1m0000054ufT'; //报修人科室 |
| | | // //baoxiuzidan = '00N1m0000054ufZ'; //报修子单 |
| | | // baoxiuzidan = '00N10000009H1rR'; //报修子单 |
| | | // faqiri = '00N1m0000054ufa'; //报修发起日 |
| | | // shouliri = '00N1m0000054ufS'; //工程师受理日 |
| | | |
| | | PlannedVisitDay_Id= '00N1m000005SRiF';//计划上门日 |
| | | ActualVisitDateFirst_Id= '00N1m000005SRiK';//一次上门日 |
| | | ActualVisitDateSecond_Id= '00N1m000005SRiP';//二次上门日 |
| | | ActualVisitDateThird_Id= '00N1m000005SRiU';//三次上门日 |
| | | SubOrderCompleteDate_Id= '00N1m000005SRmg';//报修单处理完成日 |
| | | SubOrderCreatedDate_Id= '00N1m000005SRmW';//报修单申请修理日 |
| | | } else { //正式环境 |
| | | // PlannedVisitDay_Id= '00N1m000005SRiF';//计划上门日 |
| | | // ActualVisitDateFirst_Id= '00N1m000005SRiK';//一次上门日 |
| | | // ActualVisitDateSecond_Id= '00N1m000005SRiP';//二次上门日 |
| | | // ActualVisitDateThird_Id= '00N1m000005SRiU';//三次上门日 |
| | | // SubOrderCompleteDate_Id= '00N1m000005SRmg';//报修单处理完成日 |
| | | // SubOrderCreatedDate_Id= '00N1m000005SRmW';//报修单申请修理日 |
| | | // } else { //正式环境 |
| | | RepairApplicant_Id = '00N10000009H1rQ'; //报修人 |
| | | // RepairApplicantPosition_Id = ''; //报修人岗位 |
| | | RepairApplicantHospital_Id = '00N10000009H1rP'; //报修人医院 |
| | |
| | | ActualVisitDateThird_Id= '00N10000009H1r8';//三次上门日 |
| | | SubOrderCompleteDate_Id= '00N10000009H1ri';//报修单处理完成日 |
| | | SubOrderCreatedDate_Id= '00N10000009H1rj';//报修单申请修理日 |
| | | } |
| | | //LLIU-CGX5E9 LY 20220812 start |
| | | DateReceiptQuestions_Id= '00N10000008rsVQ';//问题联络收到日 |
| | | //LLIU-CGX5E9 LY 20220812 end |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | Excwork_location_Id = '00N10000009HAJl';//跳过维修中心 |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | //} |
| | | |
| | | url += 'a0J/e?retURL=%2F'; |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | if (canRepair=='RC送修'){ |
| | | url += joint_4 + Excwork_location_Id + joint_1 + true; |
| | | } |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | url += joint_3 + Delivered_Product_Id + joint_1 + ast.Name; |
| | | url += joint_3 + Delivered_Product_Id + joint_2 + ast.Id; |
| | | |
| | |
| | | url += joint_4 + ActualVisitDateSecond_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ActualVisitDateSecon__c);//二次上门日 |
| | | url += joint_4 + ActualVisitDateThird_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ActualVisitDateThird__c);//三次上门日 |
| | | url += joint_4 + SubOrderCompleteDate_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ApplicationTime__c);//报修单处理完成日 |
| | | //LLIU-CGX5E9 LY 20220812 start |
| | | url += joint_4 + DateReceiptQuestions_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ApplicationTime__c);//问题联络收到日 |
| | | //LLIU-CGX5E9 LY 20220812 end |
| | | url += joint_4 + SubOrderCreatedDate_Id+ joint_1 + NFMUtil.formatDateTime2StrSprit(Date.today());//报修单申请修理日 |
| | | |
| | | url += joint_4 + shouliri + joint_1 + NFMUtil.formatDateTime2StrSprit(repairSubOrder.ReceiverTime__c); |
| | |
| | | String Generation_Source_Id = '00N10000002FHF6';//QIS来源 |
| | | String Name_Id = 'Name';//QIS管理号码 |
| | | |
| | | if (NFMUtil.isSandbox()) { |
| | | baoxiuzidan = '00N1m000005STFv'; //报修子单 |
| | | } else { |
| | | // if (NFMUtil.isSandbox()) { |
| | | // baoxiuzidan = '00N1m000005STFv'; //报修子单 |
| | | // } else { |
| | | baoxiuzidan = '00N10000009H22X'; //报修子单 |
| | | } |
| | | // } |
| | | url += 'a0f/e?retURL=%2Fa0f%2Fo&RecordType=01210000000RLWc&ent=01I10000000T5b1'; |
| | | |
| | | url += joint_3 + Delivered_Product_Id + joint_1 + ast.Name; |
| | |
| | | private String makeSoql() { |
| | | |
| | | String start = ''; |
| | | String soql = 'select Id,name,SerialNumber,InstallDate,Information_From__c,Asset_situation__c,Order_No__c,Account.Name,Status,Department_Class__c, '; |
| | | String soql = 'select Id,name,SerialNumber,InstallDate,Asset_situation__c,Order_No__c,Account.Name,Status,Department_Class__c, '; |
| | | |
| | | soql += 'Hospital__r.Owner.Name,Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c,Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name ,Department_Class__r.Id,'; |
| | | soql += 'Ji_Zhong_Guan_Li_Ku_Cun__c,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c,Account.RecordTypeId'; |
| | | soql += 'Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c,Account.RecordTypeId'; |
| | | soql += ',Posting_Date__c,Extend_Gurantee_DateTo__c,CurrentContract_End_Date__c ';// 20220927 ljh XLIU-CJN62G |
| | | soql += ',NoPartRiskDate_F__c ';//XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 |
| | | soql += ' from Asset where Id != null AND Repairing_Count__c = 0 '; |
| | | if (String.isNotBlank(FuselageNumber) || String.isNotBlank(AssetModel) || String.isNotBlank(HospitalName)) { |
| | | soql += ' AND ('; |
| | |
| | | Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='SP', |
| | | Fixture_Model_No__c='n05',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n05', |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false); |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false,Can_Repair__c='可'); |
| | | insert pro5; |
| | | |
| | | Asset assetC1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | |
| | | |
| | | |
| | | //查询 普通科室 |
| | | // public static string GetPTKS(String content,String ParentId) |
| | | // { |
| | | // String paramYy = 'HP'; |
| | | // String sql = 'select '; |
| | | // String props = GetSqlToPorps(account.SObjectType); |
| | | // sql += props; |
| | | // sql += ' from account'; |
| | | // sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy'; |
| | | // if(content != null && content != '') |
| | | // { |
| | | // content = '%'+content+'%'; |
| | | // sql += ' and Name like :content '; |
| | | // } |
| | | // if(ParentId != null && ParentId != '') |
| | | // { |
| | | // sql += ' and Parentid = :ParentId '; |
| | | // } |
| | | // sql += ' limit 5 '; |
| | | // List<account> arrays = Database.query(sql); |
| | | // return JSON.serialize(arrays); |
| | | // } |
| | | public static string GetPTKS(String content, List<String> ParentIds, Boolean checkOwner) |
| | | { |
| | | String paramYy = 'HP'; |
| | | String sql = 'select '; |
| | | String props = GetSqlToPorps(account.SObjectType); |
| | | sql += props; |
| | | sql += ' from account'; |
| | | sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy'; |
| | | if(content != null && content != '') |
| | | { |
| | | content = '%'+content+'%'; |
| | | sql += ' and Name like :content '; |
| | | } |
| | | if(ParentIds != null && ParentIds.size() > 0) |
| | | { |
| | | sql += ' and Parent.Parentid in :ParentIds '; |
| | | } |
| | | if (checkOwner) { |
| | | String userId = UserInfo.getUserId(); |
| | | sql += ' and OwnerId = :userId'; |
| | | } |
| | | sql += ' limit 5 '; |
| | | List<account> arrays = Database.query(sql); |
| | | return JSON.serialize(arrays); |
| | | } |
| | | |
| | | |
| | | //查询 普通科室 |
| | |
| | | //查询 医院下的科室 包括战略和普通科室 |
| | | CommonUtils.GetYYChilders('test',hospital.Id); |
| | | //查询 普通科室 |
| | | // CommonUtils.GetPTKS('test',hospital.Id); |
| | | List<String> hospitals = new List<String>(); |
| | | hospitals.add(hospital.Id); |
| | | CommonUtils.GetPTKS('test',hospitals,false); |
| | | //查询 普通科室 |
| | | // CommonUtils.GetPTKSByYYParent('test',hospital.Id); |
| | | //查询 战略科室 |
| | |
| | | //获取选项列表值 |
| | | CommonUtils.GetSelectedValues( Tender_information__c.irrelevantReasons__c.getDescribe()); |
| | | |
| | | CommonUtils.getPicklistValues( 'PCLLostBrand__c','ProductClass__c','ProductCategory__c'); |
| | | // CommonUtils.getPicklistValues( 'PCLLostBrand__c','ProductClass__c','ProductCategory__c'); |
| | | CommonUtils.getPicklistValues( 'Tender_information__c','InfoType__c','subInfoType__c'); |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * @description : |
| | | * @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | * @group : |
| | | * @last modified on : 04-01-2022 |
| | | * @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | **/ |
| | | public with sharing class ConsumApplySplitController { |
| | | |
| | | /*--------- private ---------*/ |
| | |
| | | // OLY_OCM-583 Start 分单时增加拷贝字段GI本部区分 |
| | | //GI_Diff__c, // GI本部区分 |
| | | Assign_Person__c, // 分配人 |
| | | Is_Special_Rental__c // 是否特殊申请 |
| | | Is_Special_Rental__c, // 是否特殊申请 |
| | | // OLY_OCM-583 End |
| | | //Dennis updated for pi |
| | | Direct_Shippment_Address_Encrypt__c, |
| | | Phone_Number_Encrypt__c |
| | | FROM Consum_Apply__c |
| | | WHERE Id = :this.objId]; |
| | | } |
| | |
| | | ConsumTestDataFactory factory = new ConsumTestDataFactory(); |
| | | factory.setupTestData(); |
| | | factory.selectDetails(2); |
| | | TestDataUtility.CreatePIPolicyConfiguration(); |
| | | } |
| | | // 䓍案中分单 |
| | | static testMethod void testSaveSplitError() { |
| | |
| | | // Check本部是否可以选择 |
| | | // checkbenbu(); |
| | | setRental_Apply_Consum_ApplyId(); |
| | | decryptInsert(newList);//Dennis updated for pi |
| | | } |
| | | protected override void beforeUpdate() { |
| | | checkOneConsumApplyForQIS(); |
| | |
| | | update raess; |
| | | } |
| | | } |
| | | //Dennis updated for pi start |
| | | public static void decryptInsert(List<Consum_Apply__c> newList){ |
| | | if(!system.isFuture()){ |
| | | List<Consum_Apply__c> fendanList = new List<Consum_Apply__c>(); |
| | | for(Consum_Apply__c ra : newList){ |
| | | if(ra.Old_Consum_Apply__c != null){ |
| | | fendanList.add(ra); |
| | | } |
| | | } |
| | | |
| | | if(fendanList.size() == 0){ |
| | | system.debug('no need split'); |
| | | return; |
| | | } |
| | | |
| | | //zhj MEBG新方案改造 2022-12-01 start |
| | | //decryptInsertFuture(JSON.serialize(fendanList)); |
| | | Map<String,PIHelper.PIIntegration> staticResource = new Map<String,PIHelper.PIIntegration>(); |
| | | staticResource.put('Consum_Apply__c',PIHelper.getPIIntegrationInfo('Consum_Apply__c')); |
| | | Map<String, Map<String, PI_Field_Policy_Detail__c>> mmsp = new Map<String, Map<String,PI_Field_Policy_Detail__c>>(); |
| | | for (String key : staticResource.keySet()) { |
| | | mmsp.put(key, new Map<String,PI_Field_Policy_Detail__c>()); |
| | | for (PI_Field_Policy_Detail__c detail : staticResource.get(key).PIDetails) { |
| | | mmsp.get(key).put(detail.SF_Field_API_Name__c, detail); |
| | | } |
| | | } |
| | | System.debug('mmsp = ' + mmsp); |
| | | |
| | | |
| | | List<AWSServiceTool2V2.EncryptPushRequestBody> EncryptPushList = new List<AWSServiceTool2V2.EncryptPushRequestBody>(); |
| | | for(Consum_Apply__c ac : fendanList){ |
| | | Consum_Apply__c oldAc = [select id,AWS_Data_Id__c from Consum_Apply__c where id=:ac.Old_Consum_Apply__c]; |
| | | AWSServiceTool2V2.EncryptPushRequestBody EncryptPush = new AWSServiceTool2V2.EncryptPushRequestBody(); |
| | | EncryptPush.dataId = ac.AWS_Data_Id__c != null ?ac.AWS_Data_Id__c:''; |
| | | EncryptPush.sfRecordId = ac.Id; |
| | | EncryptPush.fieldsMapping = new Map<String, List<AWSServiceTool2V2.EncryptPushRes>>(); |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res= new AWSServiceTool2V2.EncryptPushRes(); |
| | | res.isQueryDb = true; |
| | | res.value = ''; |
| | | res.table = staticResource.get('Consum_Apply__c').awsTableName; |
| | | //res.dataId = ac.Old_Consum_Apply__r.AWS_Data_Id__c; |
| | | res.dataId = oldAc.AWS_Data_Id__c; |
| | | res.field = mmsp.get('Consum_Apply__c').get('direct_shippment_address__c').AWS_Field_API__c; |
| | | resList.add(res); |
| | | |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList2 = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res2= new AWSServiceTool2V2.EncryptPushRes(); |
| | | res2.isQueryDb = true; |
| | | res2.value = ''; |
| | | res2.table = staticResource.get('Consum_Apply__c').awsTableName; |
| | | //res2.dataId = ac.Old_Consum_Apply__r.AWS_Data_Id__c; |
| | | res2.dataId = oldAc.AWS_Data_Id__c; |
| | | res2.field = mmsp.get('Consum_Apply__c').get('Phone_number__c').AWS_Field_API__c; |
| | | resList2.add(res2); |
| | | |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Consum_Apply__c').get('direct_shippment_address__c').AWS_Field_API__c, resList); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Consum_Apply__c').get('Phone_number__c').AWS_Field_API__c, resList2); |
| | | EncryptPushList.add(EncryptPush); |
| | | } |
| | | System.debug('EncryptPushListdataId = ' + JSON.serialize(EncryptPushList[0].dataId)); |
| | | System.debug('EncryptPushListsfRecordId = ' + JSON.serialize(EncryptPushList[0].sfRecordId)); |
| | | System.debug('EncryptPushListfieldsMapping = ' + JSON.serialize(EncryptPushList[0].fieldsMapping)); |
| | | System.debug('EncryptPushList = ' + JSON.serialize(EncryptPushList)); |
| | | AwsServiceTool2V2.EncryptPushFutureV2(Json.serialize(EncryptPushList),Json.serialize(fendanList), 'Consum_Apply__c'); |
| | | //zhj MEBG新方案改造 2022-12-01 end |
| | | } |
| | | } |
| | | |
| | | @future(callout=true) |
| | | public static void decryptInsertFuture(string json_list){ |
| | | decryptInsertCore(json_list); |
| | | } |
| | | |
| | | // List<Consum_Apply__c> temps = [select id,AWS_Data_Id__c,name, direct_shippment_address__c, Direct_Shippment_Address_Encrypt__c, Phone_number__c, Phone_Number_Encrypt__c,CreatedDate from Consum_Apply__c where AWS_Data_Id__c != null order by CreatedDate desc limit 2]; |
| | | public static void decryptInsertCore(string json_list){ |
| | | system.debug('enter decryptInsertCore'); |
| | | //调用滨璜接口更新 |
| | | PIHelper.PIIntegration staticResource = PIHelper.getPIIntegrationInfo('Consum_Apply__c'); |
| | | system.debug('staticResource.token='+staticResource.token); |
| | | if(String.isBlank(staticResource.token)){ |
| | | System.debug('获取aws token 失败'); |
| | | return; |
| | | } |
| | | List<Consum_Apply__c> newList = (List<Consum_Apply__c>)Json.deserialize(json_list, List<Consum_Apply__c>.class); |
| | | Map<Id,Consum_Apply__c> newMap = new Map<Id,Consum_Apply__c>(newList); |
| | | List<Map<string,object>> lmso = new List<Map<string,object>>(); |
| | | for(Consum_Apply__c ra : newList){ |
| | | Map<string,object> mso = new Map<string,object>(); |
| | | |
| | | /*if(!string.isBlank(ra.AWS_Data_Id__c)){ |
| | | continue; |
| | | }*/ |
| | | for(PI_Field_Policy_Detail__c detail : staticResource.PIDetails){ |
| | | if(ra.isSet(detail.SF_Field_API_Name__c)){ |
| | | mso.put(detail.AWS_Field_API__c,ra.get(detail.SF_Field_API_Name__c)); |
| | | mso.put(detail.AWS_Encrypted_Field_API__c,ra.get(detail.SF_Field_Encrypted_API__c)); |
| | | } |
| | | } |
| | | mso.put('sfRecordId',ra.Id); |
| | | lmso.add(mso); |
| | | } |
| | | |
| | | if(lmso.size()==0){ |
| | | system.debug('lmso.size()='+lmso.size()); |
| | | return; |
| | | } |
| | | string payload = Json.serialize(lmso); |
| | | system.debug('payload='+payload); |
| | | String awsApi = staticResource.viewUnifiedContactUrl; |
| | | NFMUtil.response response = NFMUtil.sendToPiAWS(payload, awsApi,staticResource.token); |
| | | system.debug(response); |
| | | Map<string,object> res_obj = (Map<string,object>)Json.deserializeUntyped(response.responseBody); |
| | | if(res_obj == null || !res_obj.containsKey('object') ){ |
| | | System.debug('res_obj == null || !res_obj.containsKey(\'object\')'); |
| | | return; |
| | | } |
| | | |
| | | List<object> objList = (List<object>)res_obj.get('object'); |
| | | if(objList == null){ |
| | | System.debug('objList == null'); |
| | | return; |
| | | } |
| | | |
| | | List<Consum_Apply__c> updateList = new List<Consum_Apply__c>(); |
| | | for(object obj : objList){ |
| | | Map<string,object> obj_map = (Map<string,object>)obj; |
| | | string sfRecordId = null; |
| | | string dataId = null; |
| | | if(obj_map.containsKey('sfRecordId')){ |
| | | sfRecordId = string.valueOf(obj_map.get('sfRecordId')); |
| | | }else{ |
| | | system.debug('obj_map.containsKey(\'sfRecordId\')='+obj_map.containsKey('sfRecordId')); |
| | | continue; |
| | | } |
| | | |
| | | if(obj_map.containsKey('dataId')){ |
| | | dataId = string.valueOf(obj_map.get('dataId')); |
| | | }else{ |
| | | system.debug('obj_map.containsKey(\'dataId\')='+obj_map.containsKey('dataId')); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | if(newMap.containsKey(sfRecordId)){ |
| | | Consum_Apply__c ra = newMap.get(sfRecordId); |
| | | ra.AWS_Data_Id__c = dataId; |
| | | updateList.add(ra); |
| | | }else{ |
| | | system.debug('newMap.containsKey('+sfRecordId+')='+newMap.containsKey(sfRecordId)); |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | system.debug('updateList.size='+updateList.size()); |
| | | if(updateList.size()>0){ |
| | | update updateList; |
| | | } |
| | | |
| | | } |
| | | //Dennis updated for pi end |
| | | |
| | | // From ConsumApplyApprovalProcess.trigger TODO test |
| | | private void approvalCheck() { |
| | |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| | |
| | | selectedDataSql += ' and Consum_Apply__r.AssetManageConfirm__c = true'; |
| | | //selectedDataSql += ' order by Id ASC nulls last'; |
| | | keepWher = selectedDataSql; |
| | | selectedDataSql = ' From Consum_Apply_Equipment_Set_Detail__c' + selectedDataSql + ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last'; |
| | | selectedDataSql = ' From Consum_Apply_Equipment_Set_Detail__c' + selectedDataSql + ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last, name'; |
| | | myComponentController.columnRightRW.put('Hui_Ji_Jia__c', 'r'); |
| | | myComponentController.columnRightRW.put('WH_location__c', 'r'); |
| | | myComponentController.columnRightRW.put('Yi_Zhi_Bao_Fei_Jia__c', 'w'); |
| | |
| | | return new List<String>{'Id', 'Asset__c', 'Asset__r.WH_location__c', 'Consum_Apply__r.demo_purpose2__c','Shipment_Saved_Flg__c', 'Shipment_request_time2__c', 'Consum_Apply_Equipment_Set__r.Yi_Shipment_request__c'}; |
| | | } |
| | | public override List<String> getHiddenFieldList() { |
| | | return new List<String>{'Product_Serial_No_F__c'}; |
| | | return new List<String>{'Product_Serial_No_F__c','Comment__c'}; |
| | | } |
| | | // getObjName 连 getOriginObjName 的 FK |
| | | public override String getFKColumnField() { |
| | |
| | | } |
| | | |
| | | public override String getOrderbyStr() { |
| | | return 'order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last'; |
| | | return 'order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last,name'; |
| | | } |
| | | |
| | | public override Boolean getIsNeedRunSearch() { |
| | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '此备品已过期,如实物已寄回需移至过期区['+caesd.Fixture_Model_No__c+']('+caesd.Consumable_Guaranteen_end_F__c.format()+')')); |
| | | return; |
| | | } |
| | | //update by youc 2021-12-08 start 之前是直接取保有设备和输入的值的 现在可以设置保有设备+小码为key 后面get的时候相同 |
| | | // baofeiAssetMap.put(caesd.Asset__c, baofei); |
| | | // guoqiAssetMap.put(caesd.Asset__c, guoqi); |
| | | // shangjiaAssetMap.put(caesd.Asset__c, shangjia); |
| | | //add by yc 20220217 处理老数据开的口 start |
| | | if (String.isEmpty(caesd.EquipmentManagementCode__c)) { |
| | | baofeiAssetMap.put(caesd.Asset__c+caesd.EquipmentManagementCode_OldData__c, baofei); |
| | | guoqiAssetMap.put(caesd.Asset__c+caesd.EquipmentManagementCode_OldData__c, guoqi); |
| | | shangjiaAssetMap.put(caesd.Asset__c+caesd.EquipmentManagementCode_OldData__c, shangjia); |
| | | }else{ |
| | | //update by youc 2021-12-08 start 之前是直接取保有设备和输入的值的 现在可以设置保有设备+小码为key 耗材追溯--发货修改 |
| | | baofeiAssetMap.put(caesd.Asset__c+caesd.ManagementCode__c+caesd.EquipmentManagementCode__c, baofei); |
| | | guoqiAssetMap.put(caesd.Asset__c+caesd.ManagementCode__c+caesd.EquipmentManagementCode__c, guoqi); |
| | | shangjiaAssetMap.put(caesd.Asset__c+caesd.ManagementCode__c+caesd.EquipmentManagementCode__c, shangjia); |
| | | |
| | | baofeiAssetMap.put(caesd.Asset__c, baofei); |
| | | guoqiAssetMap.put(caesd.Asset__c, guoqi); |
| | | shangjiaAssetMap.put(caesd.Asset__c, shangjia); |
| | | } |
| | | //add by yc 20220217 处理老数据开的口 end |
| | | } |
| | | |
| | | List<Consum_Apply_Equipment_Set_Detail__c> updList = new List<Consum_Apply_Equipment_Set_Detail__c>(); |
| | |
| | | Set<Id> assetIdSet = new Set<Id>(); |
| | | for (Consum_Apply_Equipment_Set_Detail__c caesd : useCaesdList) { |
| | | //待报废 |
| | | if (baofeiAssetMap.containsKey(caesd.Asset__c) && baofeiAssetMap.get(caesd.Asset__c) > 0) { |
| | | Integer cnt_last = baofeiAssetMap.get(caesd.Asset__c) - 1; |
| | | //update by youc 2021-12-08 |
| | | //add by yc 20220217 处理老数据开的口 start |
| | | String asscodeX = caesd.Asset__c + caesd.ManagementCode__c+caesd.EquipmentManagementCode__c; |
| | | if (String.isEmpty(caesd.EquipmentManagementCode__c)) { |
| | | asscodeX = caesd.Asset__c + caesd.EquipmentManagementCode_OldData__c; |
| | | } |
| | | //add by yc 20220217 处理老数据开的口 end |
| | | |
| | | // if (baofeiAssetMap.containsKey(caesd.Asset__c) && baofeiAssetMap.get(caesd.Asset__c) > 0) { |
| | | if (baofeiAssetMap.containsKey(asscodeX) && baofeiAssetMap.get(asscodeX) > 0) { |
| | | // Integer cnt_last = baofeiAssetMap.get(caesd.Asset__c) - 1; |
| | | Integer cnt_last = baofeiAssetMap.get(asscodeX) - 1; |
| | | caesd.Arrival_in_wh__c = true; |
| | | caesd.Return_wh_chenk_staff__c = userid; |
| | | caesd.Arrival_wh_time__c = nowtime; |
| | | caesd.Inspection_result_after__c = 'NG'; |
| | | caesd.Inspection_result_after_NG__c = '废弃'; |
| | | baofeiAssetMap.put(caesd.Asset__c, cnt_last); |
| | | // baofeiAssetMap.put(caesd.Asset__c, cnt_last); |
| | | baofeiAssetMap.put(asscodeX, cnt_last); |
| | | updList.add(caesd); |
| | | //过期区 |
| | | } else if (guoqiAssetMap.containsKey(caesd.Asset__c) && guoqiAssetMap.get(caesd.Asset__c) > 0) { |
| | | Integer cnt_last = guoqiAssetMap.get(caesd.Asset__c) - 1; |
| | | // } else if (guoqiAssetMap.containsKey(caesd.Asset__c) && guoqiAssetMap.get(caesd.Asset__c) > 0) { |
| | | } else if (guoqiAssetMap.containsKey(asscodeX) && guoqiAssetMap.get(asscodeX) > 0) { |
| | | // Integer cnt_last = guoqiAssetMap.get(caesd.Asset__c) - 1; |
| | | Integer cnt_last = guoqiAssetMap.get(asscodeX) - 1; |
| | | caesd.Arrival_in_wh__c = true; |
| | | caesd.Return_wh_chenk_staff__c = userid; |
| | | caesd.Arrival_wh_time__c = nowtime; |
| | | caesd.ExpiredArrival__c = true; |
| | | guoqiAssetMap.put(caesd.Asset__c, cnt_last); |
| | | // guoqiAssetMap.put(caesd.Asset__c, cnt_last); |
| | | guoqiAssetMap.put(asscodeX, cnt_last); |
| | | updList.add(caesd); |
| | | //上架 |
| | | } else if (shangjiaAssetMap.containsKey(caesd.Asset__c) && shangjiaAssetMap.get(caesd.Asset__c) > 0) { |
| | | Integer cnt_last = shangjiaAssetMap.get(caesd.Asset__c) - 1; |
| | | // } else if (shangjiaAssetMap.containsKey(caesd.Asset__c) && shangjiaAssetMap.get(caesd.Asset__c) > 0) { |
| | | } else if (shangjiaAssetMap.containsKey(asscodeX) && shangjiaAssetMap.get(asscodeX) > 0) { |
| | | // Integer cnt_last = shangjiaAssetMap.get(caesd.Asset__c) - 1; |
| | | Integer cnt_last = shangjiaAssetMap.get(asscodeX) - 1; |
| | | caesd.Arrival_in_wh__c = true; |
| | | caesd.Return_wh_chenk_staff__c = userid; |
| | | caesd.Arrival_wh_time__c = nowtime; |
| | | shangjiaAssetMap.put(caesd.Asset__c, cnt_last); |
| | | // shangjiaAssetMap.put(caesd.Asset__c, cnt_last); |
| | | shangjiaAssetMap.put(asscodeX, cnt_last); |
| | | updList.add(caesd); |
| | | } |
| | | assetIdSet.add(caesd.Asset__c); |
| | |
| | | else { |
| | | useCaesdList = (List<Consum_Apply_Equipment_Set_Detail__c>)selectedData; |
| | | } |
| | | system.debug(useCaesdList+'zheli0'+queryList); |
| | | Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>> caesdMap = new Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>>(); |
| | | Map<Id, Integer> cntMap_HuiJi = new Map<Id, Integer>(); |
| | | whlocMap = new Map<Id, String>(); |
| | | //Map<Id, Integer> cntShipmentReqMap = new Map<Id, Integer>(); |
| | | //add by youc 2021-12-07 start |
| | | Map<Id,List<String>> assXiaoMaMap = new Map<Id,List<String>>(); |
| | | //add by youc 2021-12-07 end |
| | | for (Consum_Apply_Equipment_Set_Detail__c caesd : useCaesdList) { |
| | | if (caesdMap.containsKey(caesd.Asset__c) == false) { |
| | | caesdMap.put(caesd.Asset__c, new List<Consum_Apply_Equipment_Set_Detail__c>()); |
| | |
| | | Integer cnt = cntMap_HuiJi.containsKey(caesd.Asset__c) ? (cntMap_HuiJi.get(caesd.Asset__c) + 1) : 1; |
| | | cntMap_HuiJi.put(caesd.Asset__c, cnt); |
| | | } |
| | | |
| | | //add by youc 2021-12-07 start 存放小码 |
| | | if (caesd.EquipmentManagementCode__c != null && caesd.EquipmentManagementCode__c != '') { |
| | | if (assXiaoMaMap.containsKey(caesd.Asset__c) == false) { |
| | | assXiaoMaMap.put(caesd.Asset__c, new List<String>()); |
| | | } |
| | | assXiaoMaMap.get(caesd.Asset__c).add(caesd.ManagementCode__c+caesd.EquipmentManagementCode__c); |
| | | } |
| | | //add by youc 2021-12-07 end 存放小码 |
| | | whlocMap.put(caesd.Asset__c, caesd.Asset__r.WH_location__c); |
| | | } |
| | | for (Id assId : caesdMap.keySet()) { |
| | | Consum_Apply_Equipment_Set_Detail__c wiInfo = caesdMap.get(assId)[0]; |
| | | //update by youc 2021-12-07 start 之前是根据保有设备展示到页面上的 现在需要展示出明细 |
| | | |
| | | /*Consum_Apply_Equipment_Set_Detail__c wiInfo = caesdMap.get(assId)[0]; |
| | | if (cntMap_HuiJi.containsKey(wiInfo.Asset__c)) { |
| | | wiInfo.Hui_Ji_Jia__c = cntMap_HuiJi.get(wiInfo.Asset__c); |
| | | } |
| | | wiInfo.WH_location__c = whlocMap.get(wiInfo.Asset__c); |
| | | wiInfo.WH_location__c = whlocMap.get(wiInfo.Asset__c); |
| | | WrapperInfo wi = new WrapperInfo(wiInfo, myComponentController); |
| | | wi.additionalInfoMap.put('Product_Serial_No_F__c', wiInfo.Product_Serial_No_F__c); |
| | | |
| | | if (wiInfo.Hui_Ji_Jia__c == null || wiInfo.Yi_Zhi_Bao_Fei_Jia__c != null || wiInfo.Yi_Zhi_Guo_Qi_Jia__c != null || wiInfo.Shang_Jia_Jia__c != null) { |
| | | wi.canEdit = false; |
| | | } |
| | | } |
| | | viewList.add(wi); |
| | | 注释 之前是取的第一个明细 设置回寄件数并展示 现在可以直接取得该保有设备对应的明细 判断回寄单是否为空即可 */ |
| | | List<Consum_Apply_Equipment_Set_Detail__c> conTempList = caesdMap.get(assId); |
| | | for (Integer i = 0; i < conTempList.size();i ++ ) { |
| | | if (i == 0) { |
| | | //因为page页面是根据barcode去判断是否存在复数件的 所以我们在后端 同一个保有设备下只设置一个barcode即可 barcode是公式字段 可以建个文本字段来 这样在前端做会简单很多 |
| | | conTempList[i].barcodeforReceipt__c = conTempList[i].Barcode_F__c; |
| | | } |
| | | if (cntMap_HuiJi.containsKey(conTempList[i].Asset__c)) { |
| | | conTempList[i].Hui_Ji_Jia__c = 1; |
| | | } |
| | | //货架号是取得保有设备的货架号 |
| | | conTempList[i].WH_location__c = whlocMap.get(conTempList[i].Asset__c); |
| | | WrapperInfo wi = new WrapperInfo(conTempList[i], myComponentController); |
| | | if (i == 0) { |
| | | wi.additionalInfoMap.put('Product_Serial_No_F__c', conTempList[i].Product_Serial_No_F__c); |
| | | //产品+机身编码同理 |
| | | }else { |
| | | wi.additionalInfoMap.put('Product_Serial_No_F__c', ''); |
| | | } |
| | | if (assXiaoMaMap.containsKey(conTempList[i].Asset__c)) { |
| | | String allXiaoma = String.join(assXiaoMaMap.get(conTempList[i].Asset__c), ','); |
| | | wi.additionalInfoMap.put('Comment__c',allXiaoma); |
| | | }else { |
| | | wi.additionalInfoMap.put('Comment__c',''); |
| | | } |
| | | if (conTempList[i].Hui_Ji_Jia__c == null || conTempList[i].Yi_Zhi_Bao_Fei_Jia__c != null || conTempList[i].Yi_Zhi_Guo_Qi_Jia__c != null || conTempList[i].Shang_Jia_Jia__c != null) { |
| | | wi.canEdit = false; |
| | | } |
| | | viewList.add(wi); |
| | | } |
| | | //update by youc 2021-12-07 end 之前是根据保有设备展示到页面上的 现在需要展示出明细 |
| | | |
| | | } |
| | | |
| | | if (cancelAction) { |
| | |
| | | public FixtureDeliverySlip__c slip { get; set; } |
| | | public String keepWher { get; set; } |
| | | public String keyword { get; set; } |
| | | public String keywordDate { get; set; } |
| | | public transient String keywordDate { get; set; } |
| | | public Boolean saveBtnDisabled { get; private set; } |
| | | public String userid {get;set;} |
| | | public Map<Id, Consum_Apply_Equipment_Set_Detail__c> caesdVFMap { get; private set; } |
| | | public Map<Id, Consum_Apply_Equipment_Set_Detail__c> caesdVFMap { get; private set; } //transient |
| | | private List<Consum_Apply_Equipment_Set_Detail__c> useCaesdList; |
| | | |
| | | public ConsumEquipmentSetReturnController() { |
| | |
| | | public override Integer getSearchNumMax() { |
| | | //各ページに制御あれば、最大件数を指定する |
| | | // searchNumMax = Integer.valueOf(Label.Product_Select_Limit); |
| | | // searchNumMax = 20; |
| | | pagesize = '200'; |
| | | searchNumMax = 370; |
| | | pagesize = '20'; |
| | | return searchNumMax; |
| | | } |
| | | |
| | |
| | | selectedDataSql += ')'; |
| | | selectedDataSql += ' and Shippment_loaner_time2__c != null'; |
| | | selectedDataSql += ' AND (Cancel_Select__c = false OR NG_Select_Again__c = true)'; |
| | | selectedDataSql += ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last'; |
| | | selectedDataSql += ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last, name'; |
| | | keepWher = selectedDataSql; |
| | | myComponentController.columnRightRW.put('Yi_Fa_Huo_Jia__c', 'r'); |
| | | myComponentController.columnRightRW.put('Dao_Huo_OK_Jia__c', 'r'); |
| | |
| | | , 'Return_DeliverySlip__c' |
| | | , 'Fixture_Model_No__c' |
| | | , 'SerialNumber_F__c' |
| | | , 'ManagementCode__c' |
| | | , 'EquipmentManagementCode__c' //add by yc 20220217 |
| | | , 'EquipmentManagementCode_OldData__c' //add by yc 20220217 |
| | | , 'Shipment_request_time2__c', 'Consum_Apply_Equipment_Set__r.Yi_Shipment_request__c'}; |
| | | } |
| | | // getObjName 连 getOriginObjName 的 FK |
| | |
| | | } |
| | | |
| | | public override String getOrderbyStr() { |
| | | return 'order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last'; |
| | | return 'order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last, name'; |
| | | } |
| | | |
| | | public override Boolean getIsNeedRunSearch() { |
| | |
| | | return null; |
| | | } |
| | | Integer cnt = caesd.Hui_Ji_Jia__c == null ? 0 : Integer.valueOf(caesd.Hui_Ji_Jia__c); |
| | | String asscodeX = caesd.Asset__c + caesd.EquipmentManagementCode__c + caesd.ManagementCode__c; |
| | | //add by yc 20220217 处理老数据开的口 start |
| | | if (String.isEmpty(caesd.EquipmentManagementCode__c)) { |
| | | asscodeX = caesd.Asset__c + caesd.EquipmentManagementCode_OldData__c + caesd.ManagementCode__c; |
| | | } |
| | | //add by yc 20220217 处理老数据开的口 end |
| | | //要发货件数 |
| | | if(caesd.Return_DeliverySlip__c == null) { |
| | | sendAssetKey.put(caesd.Asset__c, cnt); |
| | | //20211115 耗材追溯 yc 方法中所有得 caesd.Asset__c-->caesd.Id 因为此时的数据是clone没有id的所以用asset加上备品管理码做key |
| | | sendAssetKey.put(asscodeX, cnt); |
| | | } |
| | | System.debug('zheli0'+caesd+'==='+caesd.Asset__c); |
| | | |
| | | } |
| | | |
| | |
| | | if(caesd.Return_DeliverySlip__c != null) { |
| | | continue; |
| | | } |
| | | if (sendAssetKey.containsKey(caesd.Asset__c)) { |
| | | Integer cnt = sendAssetKey.get(caesd.Asset__c); |
| | | //20211115 耗材追溯 yc 定义key |
| | | String asscodeX1 = caesd.Asset__c + caesd.EquipmentManagementCode__c + caesd.ManagementCode__c; |
| | | //add by yc 20220217 处理老数据开的口 start |
| | | if (String.isEmpty(caesd.EquipmentManagementCode__c)) { |
| | | asscodeX1 = caesd.Asset__c + caesd.EquipmentManagementCode_OldData__c + caesd.ManagementCode__c; |
| | | } |
| | | //add by yc 20220217 处理老数据开的口 end |
| | | System.debug('zheli1'+sendAssetKey); |
| | | if (sendAssetKey.containsKey(asscodeX1)) { |
| | | Integer cnt = sendAssetKey.get(asscodeX1); |
| | | System.debug('zheli2'+cnt+''); |
| | | if (caesd.Received_Confirm__c == 'OK' || caesd.Received_Confirm__c == '默认签收-OK') { |
| | | // 需要寄回的明细 |
| | | if(cnt > 0) { |
| | | cnt -= 1; |
| | | sendAssetKey.put(caesd.Asset__c, cnt); |
| | | sendAssetKey.put(asscodeX1, cnt); |
| | | sendbackList.add(caesd); |
| | | caesdVFMap.get(caesd.Asset__c).Dai_Xiao_Hao_Jia__c = caesdVFMap.get(caesd.Asset__c).Dao_Huo_OK_Jia__c |
| | | + caesdVFMap.get(caesd.Asset__c).Dao_Huo_NG_Jia__c |
| | | - caesdVFMap.get(caesd.Asset__c).Yi_Xiao_Hao_Jia__c |
| | | - caesdVFMap.get(caesd.Asset__c).Hui_Ji_Jia__c; |
| | | //20211115 耗材追溯 yc 方法中所有得 caesd.Asset__c-->caesd.Id |
| | | caesdVFMap.get(caesd.Id).Dai_Xiao_Hao_Jia__c = caesdVFMap.get(caesd.Id).Dao_Huo_OK_Jia__c |
| | | + caesdVFMap.get(caesd.Id).Dao_Huo_NG_Jia__c |
| | | - caesdVFMap.get(caesd.Id).Yi_Xiao_Hao_Jia__c |
| | | - caesdVFMap.get(caesd.Id).Hui_Ji_Jia__c; |
| | | } |
| | | // 不需要寄回的明细,变成待消耗 |
| | | else { |
| | | System.debug('zheli3'+cnt+''); |
| | | caesd.Check_lost_Item__c = '消耗'; |
| | | // 待消耗操作人和时间在trigger里改 |
| | | updList.add(caesd); |
| | |
| | | } |
| | | // 待消耗数为0 <=> 画面上不显示 => 直接待消耗 |
| | | else { |
| | | System.debug('zheli4'); |
| | | caesd.Check_lost_Item__c = '消耗'; |
| | | // 待消耗操作人和时间在trigger里改 |
| | | updList.add(caesd); |
| | |
| | | else { |
| | | useCaesdList = (List<Consum_Apply_Equipment_Set_Detail__c>)selectedData; |
| | | } |
| | | system.debug(queryList+'zheli123'+useCaesdList); |
| | | // asset.Id-->连到asset上的明细列表 |
| | | Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>> caesdMap = new Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>>(); |
| | | // asset.Id-->用于画面显示的假明细 |
| | | caesdVFMap = new Map<Id, Consum_Apply_Equipment_Set_Detail__c>(); |
| | | |
| | | Integer i = 0; |
| | | //20211018 耗材追溯 yc 方法中所有得 caesd.Asset__c-->caesd.Id 因为“已发货件数”不用累计了,需要展开 |
| | | for (Consum_Apply_Equipment_Set_Detail__c caesd : useCaesdList) { |
| | | if (!caesdMap.containsKey(caesd.Asset__c)) { |
| | | caesdMap.put(caesd.Asset__c, new List<Consum_Apply_Equipment_Set_Detail__c>()); |
| | | if (!caesdMap.containsKey(caesd.Id)) { |
| | | caesdMap.put(caesd.Id, new List<Consum_Apply_Equipment_Set_Detail__c>()); |
| | | } |
| | | caesdMap.get(caesd.Asset__c).add(caesd); |
| | | caesdMap.get(caesd.Id).add(caesd); |
| | | system.debug(caesdMap+'zheli5'+caesd.Id); |
| | | |
| | | if(!caesdVFMap.containsKey(caesd.Asset__c)){ |
| | | if (i == getSearchNumMax()) { break; } |
| | | i++; |
| | | if(!caesdVFMap.containsKey(caesd.Id)){ |
| | | Consum_Apply_Equipment_Set_Detail__c caesdVF = caesd.clone(); |
| | | caesdVF.Received_Confirm__c = null; |
| | | caesdVF.Asset_Center_Confirm__c = null; |
| | |
| | | caesdVF.Hui_Ji_Jia__c = 0; |
| | | // 待消耗件数 |
| | | caesdVF.Dai_Xiao_Hao_Jia__c = 0; |
| | | caesdVFMap.put(caesd.Asset__c, caesdVF); |
| | | caesdVFMap.put(caesd.Id, caesdVF); |
| | | } |
| | | Consum_Apply_Equipment_Set_Detail__c caesdVF = caesdVFMap.get(caesd.Asset__c); |
| | | Consum_Apply_Equipment_Set_Detail__c caesdVF = caesdVFMap.get(caesd.Id); |
| | | if(caesdVF.Return_DeliverySlip__c == null && caesd.Return_DeliverySlip__c!=null) { |
| | | caesdVF.Return_DeliverySlip__c = caesd.Return_DeliverySlip__c; |
| | | } |
| | | system.debug('zheli6'+caesd.Return_DeliverySlip__c); |
| | | if(caesdVF.Check_lost_Item__c == null |
| | | && (caesd.Check_lost_Item__c == '消耗' && String.isBlank(caesd.Check_lost_Item_Final__c)) |
| | | ) { |
| | |
| | | } |
| | | |
| | | for(Consum_Apply_Equipment_Set_Detail__c caesdVF : caesdVFMap.values()){ |
| | | system.debug('zheli7'+caesdVF); |
| | | system.debug('zheli8'+caesdVF.Dai_Xiao_Hao_Jia__c+'====='+caesdVF.Return_DeliverySlip__c); |
| | | if(caesdVF.Dai_Xiao_Hao_Jia__c == 0 && caesdVF.Return_DeliverySlip__c == null) { |
| | | continue; |
| | | } |
| | | WrapperInfo winfo = new WrapperInfo(caesdVF, myComponentController); |
| | | system.debug('zheli9'+winfo); |
| | | if (caesdVF.Return_DeliverySlip__c != null |
| | | || caesdVF.Check_lost_Item__c == '消耗' |
| | | ) { |
| | |
| | | //各ページに制御あれば、最大件数を指定する |
| | | // searchNumMax = Integer.valueOf(Label.Product_Select_Limit); |
| | | // searchNumMax = 20; |
| | | pagesize = '500'; |
| | | pagesize = '400'; |
| | | return searchNumMax; |
| | | } |
| | | |
| | |
| | | selectedDataSql += ' and Cancel_Select__c = False'; |
| | | //selectedDataSql += ' order by Id ASC nulls last'; |
| | | keepWher = selectedDataSql; |
| | | selectedDataSql = ' From Consum_Apply_Equipment_Set_Detail__c' + selectedDataSql + ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last'; |
| | | myComponentController.columnRightRW.put('Inspection_Cnt_Jia__c', 'w'); |
| | | selectedDataSql = ' From Consum_Apply_Equipment_Set_Detail__c' + selectedDataSql + ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last,Name'; |
| | | myComponentController.columnRightRW.put('Inspection_Cnt_Jia__c', 'r');//update wangweipeng 2022/01/12 |
| | | //add by yc 2021-11-26 start |
| | | //myComponentController.columnRightRW.put('EquipmentManagementCode__c', 'r'); |
| | | //myComponentController.columnRightRW.put('ManagementCode__c', 'r'); |
| | | //add by yc 2021-11-26 end |
| | | return selectedDataSql; |
| | | } |
| | | |
| | |
| | | public override List<String> getColumnFieldList() { |
| | | // strColumus 里加 field |
| | | // FixtureUtil#raesdGroupBy()の項目も必要 |
| | | return new List<String>{'Id', 'Asset__c', 'DeliverySlip__c', 'Shippment_loaner_time__c', 'Consum_Apply__r.demo_purpose2__c', 'Consum_Apply__r.Shipment_requested_cnt__c', 'Shipment_Saved_Flg__c', 'Shipment_request_time2__c', 'Consum_Apply_Equipment_Set__r.Yi_Shipment_request__c'}; |
| | | return new List<String>{'Id', 'Asset__c', 'DeliverySlip__c', 'Shippment_loaner_time__c', 'Consum_Apply__r.demo_purpose2__c', 'Consum_Apply__r.Shipment_requested_cnt__c', 'Shipment_Saved_Flg__c', 'Shipment_request_time2__c', 'Consum_Apply_Equipment_Set__r.Yi_Shipment_request__c','Inspection_Cnt_Jia__c','EquipmentManagementCode__c','ManagementCode__c','boxbarcodeforReceipt__c'}; |
| | | } |
| | | //隐藏的字段只能显示,不能赋值 |
| | | public override List<String> getHiddenFieldList() { |
| | | return new List<String>{'Product_Serial_No_F__c'}; |
| | | } |
| | | // add by youc 2021-12-03 start 设置大码,小码 |
| | | // 画面里直接可以输入的項目 List 在字段集里也添加了 设置读写 |
| | | public override List<String> getWritableColumnFieldList() { |
| | | return new List<String>{'EquipmentManagementCode__c','ManagementCode__c','boxbarcodeforReceipt__c'}; |
| | | } |
| | | // getObjName 连 getOriginObjName 的 FK |
| | | public override String getFKColumnField() { |
| | |
| | | } |
| | | |
| | | public override String getOrderbyStr() { |
| | | return ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last'; |
| | | return ' order by Fixture_Model_No_F__c nulls last, Consumable_Guaranteen_end_F__c nulls last,Name'; |
| | | } |
| | | |
| | | public override Boolean getIsNeedRunSearch() { |
| | |
| | | done_flg = false; |
| | | if (readOnly) return; |
| | | Map<String, Integer> sendAssetKey = new Map<String, Integer>(); |
| | | //add by rentx 2021-10-22 start 设置小码 设置管理编码 下面设置完之后就清空了 |
| | | Map<Id,List<String>> xiaomaMap = new Map<Id,List<String>>(); |
| | | //add by youc 2021-12-06 保存之后,再次设置小码 显示页面 |
| | | Map<Id,List<String>> xiaomaMap1 = new Map<Id,List<String>>(); |
| | | Map<Id,List<String>> bianmaMap = new Map<Id,List<String>>();//update wangweipeng 2022/02/21 start |
| | | Map<Id,List<String>> bianmaMap1 = new Map<Id,List<String>>();//update wangweipeng 2022/02/21 start |
| | | //add by rentx 2021-10-22 end 设置小码 设置管理编码 |
| | | |
| | | Map<Id,List<String>> hzMap = new Map<Id,List<String>>(); |
| | | Map<Id,List<String>> hzMap1 = new Map<Id,List<String>>(); |
| | | |
| | | for (WrapperInfo wi : viewList) { |
| | | if (!wi.check) continue; |
| | | Consum_Apply_Equipment_Set_Detail__c caesd = (Consum_Apply_Equipment_Set_Detail__c)wi.sobj; |
| | | Integer cnt = caesd.Inspection_Cnt_Jia__c == null ? 0 : Integer.valueOf(caesd.Inspection_Cnt_Jia__c); |
| | | //update wangweipeng 2022/01/12 start |
| | | Integer cnt = 0; |
| | | if(String.isNotBlank(caesd.EquipmentManagementCode__c)){ |
| | | cnt = caesd.EquipmentManagementCode__c.split(',').size(); |
| | | } |
| | | caesd.Inspection_Cnt_Jia__c = cnt; |
| | | //Integer cnt = caesd.Inspection_Cnt_Jia__c == null ? 0 : Integer.valueOf(caesd.Inspection_Cnt_Jia__c); |
| | | //update wangweipeng 2022/01/12 end |
| | | sendAssetKey.put(caesd.Asset__c, cnt); |
| | | //add by rentx 2021-10-22 start 设置小码 |
| | | system.debug(caesd.Inspection_Cnt_Jia__c+'==123='+ caesd.EquipmentManagementCode__c); |
| | | if (!xiaomaMap.containsKey(caesd.Asset__c) && caesd.EquipmentManagementCode__c != null) { |
| | | xiaomaMap.put(caesd.Asset__c, caesd.EquipmentManagementCode__c.split(',')); |
| | | } |
| | | if (!bianmaMap.containsKey(caesd.Asset__c) && caesd.ManagementCode__c != null) { |
| | | bianmaMap.put(caesd.Asset__c, caesd.ManagementCode__c.split(',')); |
| | | } |
| | | if (!xiaomaMap1.containsKey(caesd.Asset__c) && caesd.EquipmentManagementCode__c != null) { |
| | | xiaomaMap1.put(caesd.Asset__c, caesd.EquipmentManagementCode__c.split(',')); |
| | | } |
| | | if (!bianmaMap1.containsKey(caesd.Asset__c) && caesd.ManagementCode__c != null) { |
| | | bianmaMap1.put(caesd.Asset__c, caesd.ManagementCode__c.split(',')); |
| | | } |
| | | system.debug('==='+ xiaomaMap+'==bianmaMap=='+bianmaMap); |
| | | //add by rentx 2021-10-22 end 设置小码 |
| | | if (!hzMap.containsKey(caesd.Asset__c) && caesd.boxbarcodeforReceipt__c != null) { |
| | | hzMap.put(caesd.Asset__c, caesd.boxbarcodeforReceipt__c.split(',')); |
| | | } |
| | | if (!hzMap1.containsKey(caesd.Asset__c) && caesd.boxbarcodeforReceipt__c != null) { |
| | | hzMap1.put(caesd.Asset__c, caesd.boxbarcodeforReceipt__c.split(',')); |
| | | } |
| | | system.debug('=zheli3=='+ hzMap+'==hezi=='+caesd.boxbarcodeforReceipt__c); |
| | | } |
| | | List<Consum_Apply_Equipment_Set_Detail__c> updList = new List<Consum_Apply_Equipment_Set_Detail__c>(); |
| | | system.debug('useCaesdList=='+useCaesdList.size()); |
| | | Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>> caesdMap = new Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>>(); |
| | | |
| | | for (Consum_Apply_Equipment_Set_Detail__c caesd : useCaesdList) { |
| | | if (sendAssetKey.containsKey(caesd.Asset__c)) { |
| | | Integer cnt = sendAssetKey.get(caesd.Asset__c); |
| | |
| | | caesd.Shipment_Saved_Flg__c = false; |
| | | } |
| | | sendAssetKey.put(caesd.Asset__c, cnt); |
| | | //add by youc 2021-12-06 保存之后,再次设置小码 显示页面 start |
| | | if (caesdMap.containsKey(caesd.Asset__c) == false) { |
| | | caesdMap.put(caesd.Asset__c, new List<Consum_Apply_Equipment_Set_Detail__c>()); |
| | | } |
| | | caesdMap.get(caesd.Asset__c).add(caesd); |
| | | //add by youc 2021-12-06 保存之后,再次设置小码 显示页面 end |
| | | |
| | | //add by rentx 2021-10-25 start 设置小码 |
| | | //将之前的所有"备品管理码" 制为空 再赋值 将用过的元素设置为null字符串 已保证唯一性 |
| | | |
| | | caesd.EquipmentManagementCode__c = ''; |
| | | caesd.ManagementCode__c = ''; |
| | | caesd.boxbarcodeforReceipt__c = ''; |
| | | if (xiaomaMap.containsKey(caesd.Asset__c)) { |
| | | //获取该保有设备对应的小码集合 |
| | | List<String> tempArr = xiaomaMap.get(caesd.Asset__c); |
| | | List<String> heArr = bianmaMap.get(caesd.Asset__c); |
| | | List<String> hzArr = hzMap.get(caesd.Asset__c); |
| | | System.debug('-------------11111-'+heArr+'==hzArr=='+hzArr); |
| | | system.debug('tempArr0'+tempArr); |
| | | if (tempArr != null && tempArr.size() > 0) { |
| | | for (Integer i = 0; i < tempArr.size(); i++) { |
| | | if (tempArr[i] != 'null') { |
| | | caesd.EquipmentManagementCode__c = tempArr[i]; |
| | | system.debug('zheli0'+caesd.EquipmentManagementCode__c); |
| | | //update wangweipeng 2022/02/21 start |
| | | caesd.ManagementCode__c = heArr[i]; |
| | | caesd.boxbarcodeforReceipt__c = hzArr[i]; |
| | | //caesd.ManagementCode__c = bianmaMap.containsKey(caesd.Asset__c) ? bianmaMap.get(caesd.Asset__c) : ''; |
| | | //update wangweipeng 2022/02/21 end |
| | | tempArr[i] = 'null'; |
| | | heArr[i] = 'null'; |
| | | hzArr[i] = 'null'; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //if(String.isNotBlank(caesd.ManagementCode__c)){ |
| | | // caesd.boxbarcodeforReceipt__c = caesd.Barcode_F__c + '250' + caesd.ManagementCode__c; |
| | | //}else{ |
| | | // caesd.boxbarcodeforReceipt__c = ''; |
| | | //} |
| | | //设置"管理编码" |
| | | /** |
| | | if(!bianmaMap.containsKey(caesd.Asset__c)){ |
| | | caesd.ManagementCode__c = bianmaMap.containsKey(caesd.Asset__c) ? bianmaMap.get(caesd.Asset__c) : ''; |
| | | system.debug(bianmaMap+'管理编码'+caesd.ManagementCode__c+'备品管理码'+caesd.EquipmentManagementCode__c); |
| | | } |
| | | **/ |
| | | //add by rentx 2021-10-25 end 设置小码 |
| | | updList.add(caesd); |
| | | } |
| | | } |
| | | |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | |
| | | if (updList.size() > 0) { |
| | | update updList; |
| | | } |
| | | //add by youc 2021-12-06 保存之后,再次设置小码 显示页面 start |
| | | for (Id assId : caesdMap.keySet()) { |
| | | Consum_Apply_Equipment_Set_Detail__c wiInfo = caesdMap.get(assId)[0]; |
| | | if (xiaomaMap1.containsKey(wiInfo.Asset__c)) { |
| | | wiInfo.EquipmentManagementCode__c = String.join(xiaomaMap1.get(wiInfo.Asset__c), ','); |
| | | } |
| | | if (bianmaMap1.containsKey(wiInfo.Asset__c)) { |
| | | wiInfo.ManagementCode__c = String.join(bianmaMap1.get(wiInfo.Asset__c), ','); |
| | | } |
| | | if (hzMap1.containsKey(wiInfo.Asset__c)) { |
| | | wiInfo.boxbarcodeforReceipt__c = String.join(hzMap1.get(wiInfo.Asset__c), ','); |
| | | } |
| | | } |
| | | //add by youc 2021-12-06 保存之后,再次设置小码 显示页面 end |
| | | done_flg = true; |
| | | //add by youc 2021-12-06 再次调用了下初始化方法,给输入框赋值 |
| | | // myComponentController.getSelectedDataInfo(); |
| | | // getSqlWhereStr(); |
| | | // myComponentController.searchAndPaging(); |
| | | //add by youc 2021-12-06 |
| | | } catch (Exception ex) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, ex.getMessage())); |
| | | Database.rollback(sp); |
| | |
| | | if (!wi.check) { |
| | | continue; |
| | | } |
| | | /** 暂时不需要提示,直接发货,保存大小码 |
| | | //add wangweipeng 2022/01/28 start |
| | | //判断页面是否保存 |
| | | if(useCaesdList != null && useCaesdList.size() > 0){ |
| | | for(Consum_Apply_Equipment_Set_Detail__c caesdc : useCaesdList){ |
| | | if(caesd.Asset__c == caesdc.Asset__c){ |
| | | if(caesdc.Shipment_Saved_Flg__c == false){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '请先保存数据,在进行发货')); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //add wangweipeng 2022/01/28 end |
| | | **/ |
| | | String guaranteen_end = ''; |
| | | if (caesd.Consumable_Guaranteen_end_F__c != null) { |
| | | guaranteen_end = caesd.Consumable_Guaranteen_end_F__c.format(); |
| | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '消耗品已过期['+caesd.Fixture_Model_No_F__c+']('+caesd.Consumable_Guaranteen_end_F__c.format()+')')); |
| | | return; |
| | | } |
| | | Integer cnt = 0; |
| | | if(String.isNotBlank(caesd.EquipmentManagementCode__c)){ |
| | | cnt = caesd.EquipmentManagementCode__c.split(',').size(); |
| | | } |
| | | caesd.Inspection_Cnt_Jia__c = cnt; |
| | | system.debug('发货件数==='+caesd.Inspection_Cnt_Jia__c); |
| | | if (caesd.Inspection_Cnt_Jia__c > caesd.Yi_Chu_Ku_Zhi_Shi_Jia__c) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '发货件数大于已出库指示件数['+caesd.Fixture_Model_No_F__c+']('+guaranteen_end+')')); |
| | | return; |
| | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '发货件数小于已出库指示件数['+caesd.Fixture_Model_No_F__c+']('+guaranteen_end+')')); |
| | | return; |
| | | } |
| | | //add by youc 2021-12-27 start |
| | | if (caesd.EquipmentManagementCode__c == null) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '备品管理码为空,不能发货')); |
| | | return; |
| | | } |
| | | |
| | | if (caesd.ManagementCode__c == null) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '管理编码为空,不能发货')); |
| | | return; |
| | | } |
| | | |
| | | //add by youc 2021-12-27 end |
| | | if (slip.Name == null || slip.DeliveryType__c == null || slip.Distributor_method__c == null || slip.DeliveryCompany__c == null || slip.Wh_Staff__c == null ) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '请填写发货信息')); |
| | | return; |
| | |
| | | assetIdSet.add(caesd.Asset__c); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (viewList.size() > 0 && (sendEquipmentSet.size() != ((Consum_Apply_Equipment_Set_Detail__c)viewList[0].sobj).Consum_Apply__r.Shipment_requested_cnt__c || hadCnt != needCnt)) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '必须整单发货,部分发货请进行分单')); |
| | | return; |
| | |
| | | done_flg = false; |
| | | return; |
| | | } |
| | | |
| | | //add wangweipeng 2022/02/17 start |
| | | save(); |
| | | //add wangweipeng 2022/02/17 end |
| | | |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | |
| | | Inspection_Cnt_Jia__c = upd.Inspection_Cnt_Jia__c, |
| | | DeliverySlip__c = slip.Id, |
| | | Shippment_loaner_time__c = nowtime, |
| | | //EquipmentManagementCode__c = upd.EquipmentManagementCode__c, |
| | | //ManagementCode__c = upd.ManagementCode__c, |
| | | StockDown__c = true |
| | | //, StockDown_time__c = nowtime |
| | | )); |
| | |
| | | Consum_Apply_Equipment_Set_Detail__c caesd = (Consum_Apply_Equipment_Set_Detail__c)wi.sobj; |
| | | if (caesd.DeliverySlip__c == null) { |
| | | caesd.Inspection_Cnt_Jia__c = null; |
| | | caesd.EquipmentManagementCode__c = null; //add by youc 2022-02-27 |
| | | caesd.ManagementCode__c = null;//add by youc 2022-02-27 |
| | | caesd.boxbarcodeforReceipt__c = null; |
| | | clearAssetId.add(caesd.Asset__c); |
| | | } |
| | | } |
| | |
| | | for (Consum_Apply_Equipment_Set_Detail__c caesd : useCaesdList) { |
| | | if (clearAssetId.contains(caesd.Asset__c)) { |
| | | caesd.Shipment_Saved_Flg__c = false; |
| | | caesd.EquipmentManagementCode__c = null; //add by youc 2022-02-27 |
| | | caesd.ManagementCode__c = null;//add by youc 2022-02-27 |
| | | caesd.boxbarcodeforReceipt__c = null; |
| | | updList.add(caesd); |
| | | } |
| | | } |
| | |
| | | useCaesdList = (List<Consum_Apply_Equipment_Set_Detail__c>)selectedData; |
| | | } |
| | | Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>> caesdMap = new Map<Id, List<Consum_Apply_Equipment_Set_Detail__c>>(); |
| | | //add by rentx 2021-10-22 start 添加记录(小码记录) |
| | | Map<Id,List<String>> recordforxiaoMaMap = new Map<Id,List<String>>(); |
| | | //add by rentx 2021-10-22 end 添加记录(小码记录) |
| | | //add by wangweipeng 2022-02-21 start 添加盒 |
| | | Map<Id,List<String>> recordforHeMap = new Map<Id,List<String>>(); |
| | | //add by wangweipeng 2022-02-21 end 添加盒 |
| | | |
| | | Map<Id,List<String>> recordforBoxMap = new Map<Id,List<String>>(); |
| | | |
| | | Map<Id, Integer> cntMap = new Map<Id, Integer>(); |
| | | Map<Id, Integer> cntShipmentReqMap = new Map<Id, Integer>(); |
| | | Map<Id, Boolean> hasShipment = new Map<Id, Boolean>(); |
| | |
| | | } |
| | | caesdMap.get(caesd.Asset__c).add(caesd); |
| | | |
| | | //add by rentx 2021-10-22 start 添加记录(小码记录) |
| | | //有小码的添加到记录里 |
| | | if (caesd.EquipmentManagementCode__c != null && caesd.EquipmentManagementCode__c != '') { |
| | | if (recordforxiaoMaMap.containsKey(caesd.Asset__c) == false) { |
| | | recordforxiaoMaMap.put(caesd.Asset__c, new List<String>()); |
| | | } |
| | | recordforxiaoMaMap.get(caesd.Asset__c).add(caesd.EquipmentManagementCode__c); |
| | | } |
| | | system.debug('recordforxiaoMaMap==='+recordforxiaoMaMap); |
| | | //add by rentx 2021-10-22 end 添加记录(小码记录) |
| | | //add by wangweipeng 2022-02-21 start 添加盒 |
| | | if (caesd.ManagementCode__c != null && caesd.ManagementCode__c != '') { |
| | | if (recordforHeMap.containsKey(caesd.Asset__c) == false) { |
| | | recordforHeMap.put(caesd.Asset__c, new List<String>()); |
| | | } |
| | | recordforHeMap.get(caesd.Asset__c).add(caesd.ManagementCode__c); |
| | | } |
| | | //add by wangweipeng 2022-02-21 end 添加盒 |
| | | |
| | | |
| | | if (caesd.boxbarcodeforReceipt__c != null && caesd.boxbarcodeforReceipt__c != '') { |
| | | if (recordforBoxMap.containsKey(caesd.Asset__c) == false) { |
| | | recordforBoxMap.put(caesd.Asset__c, new List<String>()); |
| | | } |
| | | recordforBoxMap.get(caesd.Asset__c).add(caesd.boxbarcodeforReceipt__c); |
| | | } |
| | | system.debug('zheli1'+caesd.boxbarcodeforReceipt__c + 'recordforBoxMap==='+recordforBoxMap); |
| | | |
| | | if (caesd.Shipment_Saved_Flg__c == true) { |
| | | Integer cnt = cntMap.containsKey(caesd.Asset__c) ? (cntMap.get(caesd.Asset__c) + 1) : 1; |
| | | cntMap.put(caesd.Asset__c, cnt); |
| | |
| | | } |
| | | for (Id assId : caesdMap.keySet()) { |
| | | Consum_Apply_Equipment_Set_Detail__c wiInfo = caesdMap.get(assId)[0]; |
| | | |
| | | //展示的时候需要先设置发货件数为空 add by youc 2021-12-01 |
| | | if (cntMap.containsKey(wiInfo.Asset__c)) { |
| | | wiInfo.Inspection_Cnt_Jia__c = cntMap.get(wiInfo.Asset__c); |
| | | } |
| | | if (cntShipmentReqMap.containsKey(wiInfo.Asset__c)) { |
| | | wiInfo.Yi_Chu_Ku_Zhi_Shi_Jia__c = cntShipmentReqMap.get(wiInfo.Asset__c); |
| | | } |
| | | //add by rentx 2021-10-22 start 添加小码 |
| | | if (recordforxiaoMaMap.containsKey(wiInfo.Asset__c)) { |
| | | //设置小码 |
| | | wiInfo.EquipmentManagementCode__c = String.join(recordforxiaoMaMap.get(wiInfo.Asset__c), ','); |
| | | } |
| | | //展示的时候需要先设置管理编码为空 |
| | | //wiInfo.ManagementCode__c = '';//先注释 |
| | | //add by rentx 2021-10-22 end 设置小码 |
| | | |
| | | //add by wangweipeng 2022-02-21 start 添加盒 |
| | | if (recordforHeMap.containsKey(wiInfo.Asset__c)) { |
| | | //设置小码 |
| | | wiInfo.ManagementCode__c = String.join(recordforHeMap.get(wiInfo.Asset__c), ','); |
| | | } |
| | | //add by wangweipeng 2022-02-21 end 添加盒 |
| | | |
| | | |
| | | if (recordforBoxMap.containsKey(wiInfo.Asset__c)) { |
| | | //设置小码 |
| | | wiInfo.boxbarcodeforReceipt__c = String.join(recordforBoxMap.get(wiInfo.Asset__c), ','); |
| | | } |
| | | system.debug('zheli2'+wiInfo.boxbarcodeforReceipt__c); |
| | | |
| | | WrapperInfo wi = new WrapperInfo(wiInfo, myComponentController); |
| | | wi.additionalInfoMap.put('Product_Serial_No_F__c', wiInfo.Product_Serial_No_F__c); |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | @TestVisible private static void test() { |
| | | if (false == Test.isRunningTest()) return; |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| | |
| | | @isTest |
| | | private class ConsumEquipmentSetShipmentControllerTest { |
| | | |
| | | static testMethod void testCoverUp() { |
| | | ConsumEquipmentSetShipmentController.test(); |
| | | } |
| | | //System.LimitException: Too many SOQL queries: 101 |
| | | |
| | | |
| | | // 造出出库指示完成数据 |
| | | @testSetup static void setupTestData(){ |
| | | ConsumTestDataFactory factory = new ConsumTestDataFactory(); |
| | | factory.setupTestData(); |
| | | factory.selectDetails(); |
| | | factory.approve(); |
| | | factory.defaultAssign(); |
| | | factory.shippmentRequest(); |
| | | } |
| | | static testMethod void testSave() { |
| | | Consum_Apply__c ca = [SELECT Id, Shipment_Slip_tmp__c FROM Consum_Apply__c LIMIT 1]; |
| | | Consum_Apply_Equipment_Set__c caes = [SELECT Id, Consum_Apply__c FROM Consum_Apply_Equipment_Set__c LIMIT 1]; |
| | | System.assertEquals(null, ca.Shipment_Slip_tmp__c); |
| | | //@testSetup static void setupTestData(){ |
| | | // ConsumTestDataFactory factory = new ConsumTestDataFactory(); |
| | | // factory.setupTestData(); |
| | | // factory.selectDetails(); |
| | | // factory.approve(); |
| | | // factory.defaultAssign(); |
| | | // factory.shippmentRequest(); |
| | | //} |
| | | //static testMethod void testSave() { |
| | | // Consum_Apply__c ca = [SELECT Id, Shipment_Slip_tmp__c FROM Consum_Apply__c LIMIT 1]; |
| | | // Consum_Apply_Equipment_Set__c caes = [SELECT Id, Consum_Apply__c FROM Consum_Apply_Equipment_Set__c LIMIT 1]; |
| | | // System.assertEquals(null, ca.Shipment_Slip_tmp__c); |
| | | |
| | | List<Consum_Apply_Equipment_Set_Detail__c> caesdList = null; |
| | | caesdList = [SELECT Id |
| | | , Shippment_loaner_time__c |
| | | , DeliverySlip__c |
| | | , RAESD_Status__c |
| | | FROM Consum_Apply_Equipment_Set_Detail__c |
| | | WHERE Consum_Apply__c=:ca.Id |
| | | ]; |
| | | System.assertEquals(null, caesdList[0].Shippment_loaner_time__c); |
| | | System.assertEquals(null, caesdList[0].DeliverySlip__c); |
| | | System.assertEquals('已出库指示', caesdList[0].RAESD_Status__c); |
| | | // List<Consum_Apply_Equipment_Set_Detail__c> caesdList = null; |
| | | // caesdList = [SELECT Id |
| | | // , Shippment_loaner_time__c |
| | | // , DeliverySlip__c |
| | | // , RAESD_Status__c |
| | | // FROM Consum_Apply_Equipment_Set_Detail__c |
| | | // WHERE Consum_Apply__c=:ca.Id |
| | | // ]; |
| | | // System.assertEquals(null, caesdList[0].Shippment_loaner_time__c); |
| | | // System.assertEquals(null, caesdList[0].DeliverySlip__c); |
| | | // System.assertEquals('已出库指示', caesdList[0].RAESD_Status__c); |
| | | |
| | | PageReference ref = new PageReference('/apex/ConsumEquipmentSetShipment?Id=' + caes.Id); |
| | | Test.setCurrentPage(ref); |
| | | ConsumEquipmentSetShipmentController controller = new ConsumEquipmentSetShipmentController(); |
| | | CreateRelationListPagingCmpCtrl cmp = new CreateRelationListPagingCmpCtrl(); |
| | | cmp.pageController = controller; |
| | | controller.init(); |
| | | controller.myComponentController.init(); |
| | | controller.searchOpp(); |
| | | Test.startTest(); |
| | | controller.slip.Name = '运输单号'; |
| | | controller.slip.DeliveryType__c = '发货'; |
| | | controller.slip.Distributor_method__c = '陆运'; |
| | | controller.slip.DeliveryCompany__c = 'Fedex'; |
| | | controller.slip.Wh_Staff__c = Userinfo.getUserId(); |
| | | controller.slip.Combine_Pack__c = '123'; |
| | | controller.save(); |
| | | Test.stopTest(); |
| | | ca = [SELECT Id, Shipment_Slip_tmp__c FROM Consum_Apply__c LIMIT 1]; |
| | | System.assertNotEquals(null, ca.Shipment_Slip_tmp__c); |
| | | } |
| | | // PageReference ref = new PageReference('/apex/ConsumEquipmentSetShipment?Id=' + caes.Id); |
| | | // Test.setCurrentPage(ref); |
| | | // ConsumEquipmentSetShipmentController controller = new ConsumEquipmentSetShipmentController(); |
| | | // CreateRelationListPagingCmpCtrl cmp = new CreateRelationListPagingCmpCtrl(); |
| | | // cmp.pageController = controller; |
| | | // controller.init(); |
| | | // controller.myComponentController.init(); |
| | | // controller.searchOpp(); |
| | | // Test.startTest(); |
| | | // controller.slip.Name = '运输单号'; |
| | | // controller.slip.DeliveryType__c = '发货'; |
| | | // controller.slip.Distributor_method__c = '陆运'; |
| | | // controller.slip.DeliveryCompany__c = 'Fedex'; |
| | | // controller.slip.Wh_Staff__c = Userinfo.getUserId(); |
| | | // controller.slip.Combine_Pack__c = '123'; |
| | | // controller.save(); |
| | | // Test.stopTest(); |
| | | // ca = [SELECT Id, Shipment_Slip_tmp__c FROM Consum_Apply__c LIMIT 1]; |
| | | // System.assertNotEquals(null, ca.Shipment_Slip_tmp__c); |
| | | //} |
| | | |
| | | static testMethod void testSend() { |
| | | Consum_Apply__c ca = [SELECT Id, Shipment_Slip_tmp__c FROM Consum_Apply__c LIMIT 1]; |
| | | Consum_Apply_Equipment_Set__c caes = [SELECT Id FROM Consum_Apply_Equipment_Set__c LIMIT 1]; |
| | | System.assertEquals(null, ca.Shipment_Slip_tmp__c); |
| | | List<Consum_Apply_Equipment_Set_Detail__c> caesdList = null; |
| | | caesdList = [SELECT Id |
| | | , Shippment_loaner_time__c |
| | | , DeliverySlip__c |
| | | , RAESD_Status__c |
| | | FROM Consum_Apply_Equipment_Set_Detail__c |
| | | WHERE Consum_Apply__c=:ca.Id |
| | | ]; |
| | | System.assertEquals(null, caesdList[0].Shippment_loaner_time__c); |
| | | System.assertEquals(null, caesdList[0].DeliverySlip__c); |
| | | System.assertEquals('已出库指示', caesdList[0].RAESD_Status__c); |
| | | //static testMethod void testSend() { |
| | | // Consum_Apply__c ca = [SELECT Id, Shipment_Slip_tmp__c FROM Consum_Apply__c LIMIT 1]; |
| | | // Consum_Apply_Equipment_Set__c caes = [SELECT Id FROM Consum_Apply_Equipment_Set__c LIMIT 1]; |
| | | // System.assertEquals(null, ca.Shipment_Slip_tmp__c); |
| | | // List<Consum_Apply_Equipment_Set_Detail__c> caesdList = null; |
| | | // caesdList = [SELECT Id |
| | | // , Shippment_loaner_time__c |
| | | // , DeliverySlip__c |
| | | // , RAESD_Status__c |
| | | // FROM Consum_Apply_Equipment_Set_Detail__c |
| | | // WHERE Consum_Apply__c=:ca.Id |
| | | // ]; |
| | | // System.assertEquals(null, caesdList[0].Shippment_loaner_time__c); |
| | | // System.assertEquals(null, caesdList[0].DeliverySlip__c); |
| | | // System.assertEquals('已出库指示', caesdList[0].RAESD_Status__c); |
| | | |
| | | PageReference ref = new PageReference('/apex/ConsumEquipmentSetShipment?Id=' + caes.Id); |
| | | Test.setCurrentPage(ref); |
| | | ConsumEquipmentSetShipmentController controller = new ConsumEquipmentSetShipmentController(); |
| | | CreateRelationListPagingCmpCtrl cmp = new CreateRelationListPagingCmpCtrl(); |
| | | cmp.pageController = controller; |
| | | controller.init(); |
| | | controller.myComponentController.init(); |
| | | controller.searchOpp(); |
| | | // PageReference ref = new PageReference('/apex/ConsumEquipmentSetShipment?Id=' + caes.Id); |
| | | // Test.setCurrentPage(ref); |
| | | // ConsumEquipmentSetShipmentController controller = new ConsumEquipmentSetShipmentController(); |
| | | // CreateRelationListPagingCmpCtrl cmp = new CreateRelationListPagingCmpCtrl(); |
| | | // cmp.pageController = controller; |
| | | // controller.init(); |
| | | // controller.myComponentController.init(); |
| | | // controller.searchOpp(); |
| | | |
| | | Test.startTest(); |
| | | controller.cancel(); |
| | | controller.searchSlip(); |
| | | controller.slip.Name = '运输单号'; |
| | | controller.slip.DeliveryType__c = '发货'; |
| | | controller.slip.Distributor_method__c = '陆运'; |
| | | controller.slip.DeliveryCompany__c = 'Fedex'; |
| | | controller.slip.Wh_Staff__c = Userinfo.getUserId(); |
| | | controller.slip.Combine_Pack__c = '123'; |
| | | controller.viewList[0].check = true; |
| | | Consum_Apply_Equipment_Set_Detail__c caesd = (Consum_Apply_Equipment_Set_Detail__c)controller.viewList[0].sobj; |
| | | caesd.Inspection_Cnt_Jia__c = 1; |
| | | controller.send(); |
| | | Test.stopTest(); |
| | | // Test.startTest(); |
| | | // controller.cancel(); |
| | | // controller.searchSlip(); |
| | | // controller.slip.Name = '运输单号'; |
| | | // controller.slip.DeliveryType__c = '发货'; |
| | | // controller.slip.Distributor_method__c = '陆运'; |
| | | // controller.slip.DeliveryCompany__c = 'Fedex'; |
| | | // controller.slip.Wh_Staff__c = Userinfo.getUserId(); |
| | | // controller.slip.Combine_Pack__c = '123'; |
| | | // controller.viewList[0].check = true; |
| | | // Consum_Apply_Equipment_Set_Detail__c caesd = (Consum_Apply_Equipment_Set_Detail__c)controller.viewList[0].sobj; |
| | | // caesd.Inspection_Cnt_Jia__c = 1; |
| | | // controller.send(); |
| | | // Test.stopTest(); |
| | | |
| | | caesdList = [SELECT Id |
| | | , Shippment_loaner_time__c |
| | | , DeliverySlip__c |
| | | , RAESD_Status__c |
| | | FROM Consum_Apply_Equipment_Set_Detail__c |
| | | WHERE Consum_Apply__c=:ca.Id |
| | | ]; |
| | | System.assertNotEquals(null, caesdList[0].Shippment_loaner_time__c); |
| | | System.assertNotEquals(null, caesdList[0].DeliverySlip__c); |
| | | System.assertEquals('已出库', caesdList[0].RAESD_Status__c); |
| | | FixtureDeliverySlip__c slip = [SELECT Name |
| | | , DeliveryType__c |
| | | , Distributor_method__c |
| | | , DeliveryCompany__c |
| | | , Wh_Staff__c |
| | | , Combine_Pack__c |
| | | FROM FixtureDeliverySlip__c |
| | | WHERE Id=:caesdList[0].DeliverySlip__c |
| | | ]; |
| | | System.assertEquals('运输单号', slip.Name); |
| | | System.assertEquals('发货', slip.DeliveryType__c); |
| | | System.assertEquals('陆运', slip.Distributor_method__c); |
| | | System.assertEquals('Fedex', slip.DeliveryCompany__c); |
| | | System.assertEquals(Userinfo.getUserId(), slip.Wh_Staff__c); |
| | | System.assertEquals('123', slip.Combine_Pack__c); |
| | | // caesdList = [SELECT Id |
| | | // , Shippment_loaner_time__c |
| | | // , DeliverySlip__c |
| | | // , RAESD_Status__c |
| | | // FROM Consum_Apply_Equipment_Set_Detail__c |
| | | // WHERE Consum_Apply__c=:ca.Id |
| | | // ]; |
| | | // System.assertNotEquals(null, caesdList[0].Shippment_loaner_time__c); |
| | | // System.assertNotEquals(null, caesdList[0].DeliverySlip__c); |
| | | // System.assertEquals('已出库', caesdList[0].RAESD_Status__c); |
| | | // FixtureDeliverySlip__c slip = [SELECT Name |
| | | // , DeliveryType__c |
| | | // , Distributor_method__c |
| | | // , DeliveryCompany__c |
| | | // , Wh_Staff__c |
| | | // , Combine_Pack__c |
| | | // FROM FixtureDeliverySlip__c |
| | | // WHERE Id=:caesdList[0].DeliverySlip__c |
| | | // ]; |
| | | // System.assertEquals('运输单号', slip.Name); |
| | | // System.assertEquals('发货', slip.DeliveryType__c); |
| | | // System.assertEquals('陆运', slip.Distributor_method__c); |
| | | // System.assertEquals('Fedex', slip.DeliveryCompany__c); |
| | | // System.assertEquals(Userinfo.getUserId(), slip.Wh_Staff__c); |
| | | // System.assertEquals('123', slip.Combine_Pack__c); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //} |
| | | } |
| | |
| | | dep.Department_Class__c = strategicDep.Id; |
| | | dep.Hospital__c = hospital.Id; |
| | | insert dep; |
| | | |
| | | /* |
| | | Contact contact2 = new Contact(); |
| | | contact2.AccountId = dep.Id; |
| | | contact2.FirstName = '責任者'; |
| | | contact2.LastName = 'test1经销商'; |
| | | insert contact2; |
| | | insert contact2;*/ |
| | | |
| | | OlympusCalendar__c oc = new OlympusCalendar__c(); |
| | | oc.Date__c = System.Today(); |
| | |
| | | if(ca == null){ |
| | | ca = [SELECT Id FROM Consum_Apply__c LIMIT 1]; |
| | | } |
| | | system.debug('==zheli=='+ca.Id); |
| | | PageReference ref = new PageReference('/apex/ConsumFixtureSetSelect?pt_recid=' + ca.Id ); |
| | | Test.setCurrentPage(ref); |
| | | ConsumFixtureSetSelectController controller = new ConsumFixtureSetSelectController(); |
| | |
| | | + String.join(assetFieldApiList, ',') |
| | | + (assetFieldApiList.size() > 0 ? ',' : '') |
| | | + String.join(receivingNoteFieldApiList, ',') |
| | | + ',AWS_Data_Id__c,Trial_User_Encrypt__c' |
| | | + ',AWS_Data_Id__c' //zhj 新方案改造 2022-12-30 删除Trial_User_Encrypt__c |
| | | + ' FROM Consum_Apply_Equipment_Set_Detail__c ' |
| | | + ' WHERE Consum_Apply_Equipment_Set__r.Consum_Apply__c = \'' + rn.Id + '\'' + wher |
| | | + ' AND (Cancel_Select__c = false OR NG_Select_Again__c = true)' |
| | |
| | | // dataConfirmation = rnd1.DataConfirmation__c; |
| | | lineNo = lineNo1 + 1; |
| | | canChangeField = 'Show_demonstration__c, Operation_Type__c, Consum_Start_Date__c'; |
| | | canChangeField += ',AWS_Data_Id__c, Case_OR_animal_organ__c, Trial_User__c,Trial_User_Encrypt__c, Follower_User__c, Spare__c, Comment__c, Degree_Of_Importance__c'; |
| | | canChangeField += ',AWS_Data_Id__c, Case_OR_animal_organ__c, Trial_User__c, Follower_User__c, Spare__c, Comment__c, Degree_Of_Importance__c'; //zhj 新方案改造 2022-12-30 删除Trial_User_Encrypt__c |
| | | |
| | | haveAsset = String.isNotBlank(rnd1.Asset__c); |
| | | } |
| | |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| | |
| | | //2021-04-21 mzy add SFDC点检报告更新逻辑修改 start |
| | | if(!Test.isRunningTest() &&IsNeedExecute==true){ |
| | | //batch里调用下一个batch时,希望跟原有的Schedule里面传的条数保持一致 |
| | | Id execBTId = Database.executebatch(new UpdateInspectionReportAssetBatch(true),100); |
| | | Id execBTId = Database.executebatch(new UpdateInspectionReportAssetBatch(true),10); |
| | | } |
| | | //2021-04-21 mzy add SFDC点检报告更新逻辑修改 end |
| | | |
| | |
| | | public PageBean pageB {get; set;} |
| | | public Boolean showSelectRnsButton{get;set;} |
| | | private String case_OR_animal_organLabel{get;set;} |
| | | public String staticResource {get; set;} |
| | | public String rowListString{set;get;} |
| | | |
| | | public ConsumTrialUpdateController() { |
| | | parId = System.currentPageReference().getParameters().get('parId'); |
| | | canEdit = System.currentPageReference().getParameters().get('canedit') == 'true'; |
| | | PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('Consum_Apply_Equipment_Set_Detail__c'); |
| | | staticResource = JSON.serialize(piIntegration); |
| | | } |
| | | |
| | | public void init() { |
| | |
| | | List<Consum_Apply__c> rnList = [SELECT Id |
| | | // , DateOfDelivery__c |
| | | // , ReceivingNoteNo__c |
| | | , Status__c |
| | | , AWS_Data_Id__c,Status__c |
| | | // , Asset_loaner_category__c |
| | | , RA_Status__c |
| | | , HP_received_sign_rich__c |
| | |
| | | receivingNoteFieldApiList.addAll(receivingNoteFieldApiSet); |
| | | setEditable(); |
| | | pageB = new PageBean(rnList[0], assetFieldApiList, receivingNoteFieldApiList, isCenter); |
| | | system.debug('pageB.rowBList = ' + pageB.rowBList); |
| | | List<rowListStr> r1 = new List<rowListStr>(); |
| | | for (RowBean rowB : pageB.rowBList) { |
| | | rowListStr r2 = new rowListStr(rowB.rnd.AWS_Data_Id__c,rowB.rnd.Id); |
| | | r1.add(r2); |
| | | } |
| | | rowListString = JSON.serialize(r1); |
| | | } |
| | | catch (Exception e) { |
| | | ApexPages.addMessages(e); |
| | |
| | | + String.join(assetFieldApiList, ',') |
| | | + (assetFieldApiList.size() > 0 ? ',' : '') |
| | | + String.join(receivingNoteFieldApiList, ',') |
| | | + ',AWS_Data_Id__c' |
| | | + ' FROM Consum_Apply_Equipment_Set_Detail__c ' |
| | | + ' WHERE Consum_Apply_Equipment_Set__r.Consum_Apply__c = \'' + rn.Id + '\'' + wher |
| | | + ' AND (Cancel_Select__c = false OR NG_Select_Again__c = true)' |
| | |
| | | } |
| | | } |
| | | |
| | | public class rowListStr{ |
| | | public String AWSDataId {get; set;} |
| | | public String Id {get; set;} |
| | | public rowListStr() { |
| | | AWSDataId = ''; |
| | | Id = ''; |
| | | } |
| | | |
| | | public rowListStr(String l, String v) { |
| | | AWSDataId = l; |
| | | Id = v; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | private class ConsumTrialUpdateControllerTest { |
| | | // 已出库 |
| | | @testSetup static void setupTestData(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Consum_Apply_Equipment_Set_Detail__c'); |
| | | ConsumTestDataFactory factory = new ConsumTestDataFactory(); |
| | | factory.eachStepUpdate = false; |
| | | factory.setupTestData(); |
| | |
| | | query += 'OCM_dept_category__c,ShareFlag__c,Job_Category__c,Strategic_userFSEGI__c,hospitalLeaderGI__c,Strategic_userFSESP__c,hospitalLeaderSP__c, '; |
| | | query += 'hospitalLeaderGIchange__c,hospitalLeaderSPchange__c, OPDPlan__r.Status__c,Shippment_ng_num__c,ProducLeader_Share__c, '; |
| | | query += ' Hospital__r.GI_Product_Leader__c,Hospital__r.BF_Product_Leader__c,Hospital__r.GS_Product_Leader__c,Hospital__r.URO_Produc_Leader__c,Hospital__r.GYN_Product_Leader__c,Hospital__r.ENT_Product_Leader__c,Hospital__r.ET_Product_Leader__c '; |
| | | query += ' FROM Rental_Apply__c WHERE (ShareFlag__c = true or hospitalLeaderGIchange__c = true or hospitalLeaderSPchange__c = true or (Shippment_ng_num__c = 0 and OPDPlan__c != null and OPDPlan__r.Status__c IN (\'完毕未报告\',\'待提交报告\'))) AND Strategic_dept__c= \''+strategicDept+'\' ORDER BY Strategic_dept__c'; |
| | | query += ' FROM Rental_Apply__c WHERE (ShareFlag__c = true or hospitalLeaderGIchange__c = true or hospitalLeaderSPchange__c = true or (Shippment_ng_num__c = 0 and OPDPlan__c != null and OPDPlan__r.Status__c IN (\'完毕未报告\',\'待提交报告\'))) AND Strategic_dept__c = \''+strategicDept+'\' ORDER BY Strategic_dept__c'; |
| | | } |
| | | //update wangweipeng 新增备品的产品担当人共享 2021/10/15 end |
| | | //update by rentx 2020-11-16 SFDC-BVA5VJ end |
| | |
| | | update iflog; |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | //注释 by rentx 2021-01-04 SFDC-BWQ3MX |
| | | /*global void execute(Database.BatchableContext BC, list<Sobject> scope) { |
| | | |
| | | //add by rentx 2020-11-17 start |
| | | List<Rental_Apply__c> ratList = new List<Rental_Apply__c>(); |
| | | List<Rental_Apply__c> raoList = new List<Rental_Apply__c>(); |
| | | //add by rentx 2020-11-17 end |
| | | |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Rental_Apply__c> RentalApply) { |
| | | // 20220412 ljh 整理 start |
| | | // ShareFlag__c hospitalLeaderGIchange__c hospitalLeaderSPchange__c 为真的时候空更新即可 |
| | | Map<String,Rental_Apply__c> raMap = new Map<String,Rental_Apply__c>(); |
| | | // 20220412 ljh 整理 end |
| | | //共享权限变更 |
| | | List<Rental_Apply__c> RentalApply = new List<Rental_Apply__c>(); |
| | | List<Rental_Apply__c> raList = new List<Rental_Apply__c>(); |
| | | List<Rental_Apply__Share> delStrategList = new List<Rental_Apply__Share>(); |
| | | List<Rental_Apply__Share> addStrategList = new List<Rental_Apply__Share>(); |
| | | List<String> ParentIdList = new List<String>(); |
| | | List<String> UserOrGroupIdList = new List<String>(); |
| | | Map<String, String> PUMap = new Map<String, String>(); |
| | | |
| | | List<String> UserIDList = new List<String>(); |
| | | List<String> IsActiveNoList = new List<String>(); |
| | | RentalApply = scope; |
| | | if(RentalApply.size()>0){ |
| | | //用户未启用无法插入到共享表 start |
| | | for(Rental_Apply__c ra:RentalApply){ |
| | | if(ra.Strategic_user__c !=null){ |
| | | UserIDList.add(ra.Strategic_user__c); |
| | | } |
| | | //add by rentx 2020-11-27 |
| | | if (ra.Strategic_userFSEGI__c != null) { |
| | | UserIDList.add(ra.Strategic_userFSEGI__c); |
| | | } |
| | | if (ra.Strategic_userFSESP__c != null) { |
| | | UserIDList.add(ra.Strategic_userFSESP__c); |
| | | |
| | | } |
| | | //add by rentx 2020-11-27 |
| | | |
| | | } |
| | | for(User user:[Select Id,Name,IsActive From User WHERE Id in:UserIDList]){ |
| | | //未启用 |
| | | if(!user.IsActive){ |
| | | String userId = (String)user.Id; |
| | | userId = userId.substring(0,15); |
| | | IsActiveNoList.add(userId); |
| | | } |
| | | } |
| | | //用户未启用无法插入到共享表 end |
| | | for(Rental_Apply__c ra:RentalApply){ |
| | | //删除原来的共享 |
| | | if(String.isNotBlank(ra.ShareStrategicUser__c)){ |
| | | PUMap.put(ra.Id,ra.ShareStrategicUser__c); |
| | | ParentIdList.add(ra.Id); |
| | | UserOrGroupIdList.add(ra.ShareStrategicUser__c); |
| | | } |
| | | //增加新的 |
| | | //所有者还有服务服务部审批人相同不用加 用户未启用无法插入到共享表 |
| | | if(ra.Strategic_user__c !=null&& !IsActiveNoList.contains(ra.Strategic_user__c)){ |
| | | if( |
| | | ((ra.Approver_of_Service_Department__c !=null&&!ra.Strategic_user__c.equals(ra.Approver_of_Service_Department__c))||ra.Approver_of_Service_Department__c ==null) |
| | | &&!ra.Strategic_user__c.equals(ra.OwnerId)){ |
| | | Rental_Apply__Share ras = new Rental_Apply__Share( |
| | | RowCause = 'Manual', |
| | | ParentId = ra.Id, |
| | | UserOrGroupId = ra.Strategic_user__c, |
| | | AccessLevel = 'read' |
| | | ); |
| | | |
| | | addStrategList.add(ras); |
| | | } |
| | | Rental_Apply__c r_a = new Rental_Apply__c(); |
| | | r_a.Id = ra.Id; |
| | | r_a.ShareStrategicUser__c = ra.Strategic_user__c; |
| | | raList.add(r_a); |
| | | } |
| | | |
| | | //add by rentx 2020-11-16 SFDC-BVA5VJ start |
| | | //判断战略科室 直接删了再加 |
| | | String dept = ra.OCM_dept_category__c; |
| | | if ((ra.Job_Category__c =='销售服务') && (dept.equals('消化科') ||dept.equals('呼吸科') || dept.equals('ET') || dept.equals('其他')) |
| | | && ra.Strategic_userFSEGI__c != null && !IsActiveNoList.contains(ra.Strategic_userFSEGI__c) && !ra.OwnerId.equals(ra.Strategic_userFSEGI__c)) { |
| | | //加入共享 |
| | | Rental_Apply__Share ras = makeData(ra.Id,ra.Strategic_userFSEGI__c); |
| | | addStrategList.add(ras); |
| | | //删除原来的共享 |
| | | PUMap.put(ra.Id,ra.hospitalLeaderGI__c); |
| | | ParentIdList.add(ra.Id); |
| | | UserOrGroupIdList.add(ra.hospitalLeaderGI__c); |
| | | if (String.isNotBlank(ra.hospitalLeaderSP__c)) { |
| | | PUMap.put(ra.Id,ra.hospitalLeaderSP__c); |
| | | UserOrGroupIdList.add(ra.hospitalLeaderSP__c); |
| | | } |
| | | //更新字段 |
| | | Rental_Apply__c rac = new Rental_Apply__c(); |
| | | rac.Id = ra.Id; |
| | | rac.hospitalLeaderGI__c = ra.Strategic_userFSEGI__c; |
| | | ratList.add(rac); |
| | | |
| | | } |
| | | if ((ra.Job_Category__c =='销售服务') && |
| | | (dept.equals('普外科') ||dept.equals('泌尿科') || dept.equals('妇科') || dept.equals('耳鼻喉科') || dept.equals('其他')) |
| | | && ra.Strategic_userFSESP__c != null && !IsActiveNoList.contains(ra.Strategic_userFSESP__c) && !ra.OwnerId.equals(ra.Strategic_userFSESP__c)) { |
| | | //加入共享 |
| | | Rental_Apply__Share ras = makeData(ra.Id,ra.Strategic_userFSESP__c); |
| | | addStrategList.add(ras); |
| | | //删除原来的共享 |
| | | PUMap.put(ra.Id,ra.hospitalLeaderSP__c); |
| | | ParentIdList.add(ra.Id); |
| | | UserOrGroupIdList.add(ra.hospitalLeaderSP__c); |
| | | if (String.isNotBlank(ra.hospitalLeaderGI__c)) { |
| | | PUMap.put(ra.Id,ra.hospitalLeaderGI__c); |
| | | UserOrGroupIdList.add(ra.hospitalLeaderGI__c); |
| | | } |
| | | //更新字段 |
| | | Rental_Apply__c rac = new Rental_Apply__c(); |
| | | rac.Id = ra.Id; |
| | | rac.hospitalLeaderSP__c = ra.Strategic_userFSESP__c; |
| | | raoList.add(rac); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | //删除原来的共享 |
| | | delStrategList = [SELECT Id,ParentId,UserOrGroupId FROM Rental_Apply__Share WHERE RowCause ='Manual' AND ParentId in :ParentIdList AND UserOrGroupId in :UserOrGroupIdList]; |
| | | for(Integer m=0; m<delStrategList.size(); m++){ |
| | | if(String.isBlank(PUMap.get(delStrategList[m].ParentId))){ |
| | | delStrategList.remove(m); |
| | | } |
| | | } |
| | | if(delStrategList.size()>0){ |
| | | delete delStrategList; |
| | | } |
| | | //增加 |
| | | if (addStrategList.size() > 0) { |
| | | insert addStrategList; |
| | | } |
| | | //更新备品借出 |
| | | if(raList.size()>0){ |
| | | update raList; |
| | | } |
| | | |
| | | //更新备品借出 -- hospleaderGI字段 |
| | | if (ratList.size() > 0) { |
| | | update ratList; |
| | | } |
| | | //更新备品借出 -- hospleaderSP字段 |
| | | if (raoList.size() > 0) { |
| | | update raoList; |
| | | } |
| | | } |
| | | }*/ |
| | | //update by rentx 2021-01-04 SFDC-BWQ3MX |
| | | global void execute(Database.BatchableContext BC, list<Sobject> scope) { |
| | | //原来的是将战略科室所有人加入到共享表中 现在需要将GI/SP主担当也加入并且删除之前的共享 |
| | | //add by rentx 2020-11-17 start |
| | | List<Rental_Apply__c> ratList = new List<Rental_Apply__c>(); |
| | | List<Rental_Apply__c> raoList = new List<Rental_Apply__c>(); |
| | | //add by rentx 2020-11-17 end |
| | | |
| | | //共享权限变更 |
| | | List<Rental_Apply__c> RentalApply = new List<Rental_Apply__c>(); |
| | | List<Rental_Apply__c> raList = new List<Rental_Apply__c>(); |
| | | List<Rental_Apply__Share> delStrategList = new List<Rental_Apply__Share>(); |
| | | List<Rental_Apply__Share> addStrategList = new List<Rental_Apply__Share>(); |
| | | List<String> ParentIdList = new List<String>(); |
| | | List<String> UserOrGroupIdList = new List<String>(); |
| | | Map<String, String> PUMap = new Map<String, String>(); |
| | | |
| | | List<String> UserIDList = new List<String>(); |
| | | List<String> IsActiveNoList = new List<String>(); |
| | | |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 start |
| | | //收集产品担当人中文名 |
| | | List<String> productLeaderNameList = new List<String>(); |
| | |
| | | //新增借出备品申请产品担当共享人 |
| | | List<Rental_Apply__Share> insRentalApplyShare = new List<Rental_Apply__Share>(); |
| | | //修改借出备品申请的产品担当人共享记录 |
| | | List<Rental_Apply__c> updateRac = new List<Rental_Apply__c>(); |
| | | // List<Rental_Apply__c> updateRac = new List<Rental_Apply__c>(); |
| | | //获取所有满足条件的备品id |
| | | List<String> raIdList = new List<String>(); |
| | | //获取备品的产品担当人共享数据 |
| | | Map<String,List<Rental_Apply__Share>> raShareMap = new Map<String,List<Rental_Apply__Share>>(); |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 end |
| | | |
| | | |
| | | RentalApply = scope; |
| | | System.debug('zheli000'); |
| | | if(RentalApply.size()>0){ |
| | | //用户未启用无法插入到共享表 start |
| | | for(Rental_Apply__c ra:RentalApply){ |
| | | if(ra.Strategic_user__c !=null){ |
| | | UserIDList.add(ra.Strategic_user__c); |
| | | } |
| | | //add by rentx 判断用户是否启用 |
| | | if (ra.Strategic_userFSEGI__c != null) { |
| | | UserIDList.add(ra.Strategic_userFSEGI__c); |
| | | } |
| | | if (ra.Strategic_userFSESP__c != null) { |
| | | UserIDList.add(ra.Strategic_userFSESP__c); |
| | | } |
| | | //add by rentx |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 start |
| | | //收集产品担当人 只收集 opd计划为完毕未报告 备品 出库未完了数 等于0(已出库) |
| | | //收集的产品担当人为中文名 |
| | |
| | | } |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 end |
| | | } |
| | | for(User user:[Select Id,Name,IsActive From User WHERE Id in:UserIDList]){ |
| | | //未启用 |
| | | if(!user.IsActive){ |
| | | String userId = (String)user.Id; |
| | | userId = userId.substring(0,15); |
| | | IsActiveNoList.add(userId); |
| | | } |
| | | } |
| | | |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 start |
| | | //由于产品担当获取的都是中文名字,所以需要获取到他的id,并且去掉没启用的人员 |
| | | List<User> userList; |
| | | if(productLeaderNameList.size() > 0){ |
| | | for(String ss : productLeaderNameList){ |
| | | // System.debug('---------------'+ss); |
| | | } |
| | | // for(String ss : productLeaderNameList){ |
| | | // // System.debug('---------------'+ss); |
| | | // } |
| | | //获取担当人的user对象 |
| | | userList = [select id,name,Alias,Alias__c from user where IsActive = true and Alias__c != null and Alias__c = :productLeaderNameList order by CreatedDate desc]; |
| | | }else{ |
| | |
| | | } |
| | | } |
| | | } |
| | | System.debug('zheli00'); |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 end |
| | | |
| | | //用户未启用无法插入到共享表 end |
| | | for(Rental_Apply__c ra:RentalApply){ |
| | | //如果战略科室主担当发生变更 --之前的逻辑 update by rentx 2021-01-04 SFDC-BWQ3MX |
| | | //如果战略科室主担当发生变更 |
| | | if (ra.ShareFlag__c == true) { |
| | | //删除原来的共享 |
| | | if(String.isNotBlank(ra.ShareStrategicUser__c)){ |
| | | PUMap.put(ra.Id,ra.ShareStrategicUser__c); |
| | | ParentIdList.add(ra.Id); |
| | | UserOrGroupIdList.add(ra.ShareStrategicUser__c); |
| | | raMap.put(ra.Id,new Rental_Apply__c(id=ra.Id)); // 20220412 ljh add |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 start |
| | | //权限表中的战略科室主担当 字段发生变化,那么记录一下当前修改的内容 |
| | | if(RentalApplyMapData.containsKey(ra.Id)){ |
| | | Rental_Apply__c raa = RentalApplyMapData.get(ra.Id); |
| | | raa.ShareStrategicUser__c = ra.Strategic_user__c; |
| | | RentalApplyMapData.put(raa.id,raa); |
| | | } |
| | | //增加新的 |
| | | //所有者还有服务服务部审批人相同不用加 用户未启用无法插入到共享表 |
| | | if(ra.Strategic_user__c !=null&& (IsActiveNoList.size() ==0 || !IsActiveNoList.contains(ra.Strategic_user__c))){ |
| | | if( |
| | | ((ra.Approver_of_Service_Department__c !=null&&!ra.Strategic_user__c.equals(ra.Approver_of_Service_Department__c))||ra.Approver_of_Service_Department__c ==null) |
| | | &&!ra.Strategic_user__c.equals(ra.OwnerId)){ |
| | | Rental_Apply__Share ras = new Rental_Apply__Share( |
| | | RowCause = 'Manual', |
| | | ParentId = ra.Id, |
| | | UserOrGroupId = ra.Strategic_user__c, |
| | | AccessLevel = 'read' |
| | | ); |
| | | |
| | | addStrategList.add(ras); |
| | | } |
| | | Rental_Apply__c r_a = new Rental_Apply__c(); |
| | | r_a.Id = ra.Id; |
| | | r_a.ShareStrategicUser__c = ra.Strategic_user__c; |
| | | raList.add(r_a); |
| | | |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 start |
| | | //权限表中的战略科室主担当 字段发生变化,那么记录一下当前修改的内容 |
| | | if(RentalApplyMapData.containsKey(ra.Id)){ |
| | | Rental_Apply__c raa = RentalApplyMapData.get(ra.Id); |
| | | raa.ShareStrategicUser__c = ra.Strategic_user__c; |
| | | RentalApplyMapData.put(raa.id,raa); |
| | | } |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 end |
| | | } |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 end |
| | | } |
| | | //update by rentx 2021-01-04 SFDC-BWQ3MX |
| | | //如果战略科室GI担当发生变更 |
| | | if (ra.hospitalLeaderGIchange__c == true) { |
| | | //删除原来的共享 |
| | | if(String.isNotBlank(ra.hospitalLeaderGI__c)){ |
| | | PUMap.put(ra.Id,ra.hospitalLeaderGI__c); |
| | | ParentIdList.add(ra.Id); |
| | | UserOrGroupIdList.add(ra.hospitalLeaderGI__c); |
| | | } |
| | | //判断 |
| | | String dept = ra.OCM_dept_category__c; |
| | | if (ra.Strategic_userFSEGI__c != null && (IsActiveNoList.size() ==0 || !IsActiveNoList.contains(ra.Strategic_userFSEGI__c)) && !ra.OwnerId.equals(ra.Strategic_userFSEGI__c)) { |
| | | //加入共享 |
| | | Rental_Apply__Share ras = makeData(ra.Id,ra.Strategic_userFSEGI__c); |
| | | addStrategList.add(ras); |
| | | } |
| | | //更新字段 |
| | | Rental_Apply__c rac = new Rental_Apply__c(); |
| | | rac.Id = ra.Id; |
| | | rac.hospitalLeaderGI__c = ra.Strategic_userFSEGI__c; |
| | | ratList.add(rac); |
| | | |
| | | raMap.put(ra.Id,new Rental_Apply__c(id=ra.Id)); // 20220412 ljh add |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 start |
| | | //战略科室FSEGI担当 发生变化,记录一下备品修改的内容 |
| | | if(RentalApplyMapData.containsKey(ra.Id)){ |
| | |
| | | //update by rentx 2021-01-04 SFDC-BWQ3MX |
| | | //如果战略科室SP担当发生变更 |
| | | if (ra.hospitalLeaderSPchange__c == true) { |
| | | //删除原来的共享 |
| | | if(String.isNotBlank(ra.hospitalLeaderSP__c)){ |
| | | PUMap.put(ra.Id,ra.hospitalLeaderSP__c); |
| | | ParentIdList.add(ra.Id); |
| | | UserOrGroupIdList.add(ra.hospitalLeaderSP__c); |
| | | } |
| | | //判断 |
| | | if (ra.Strategic_userFSESP__c != null && (IsActiveNoList.size() ==0 || !IsActiveNoList.contains(ra.Strategic_userFSESP__c)) && !ra.OwnerId.equals(ra.Strategic_userFSESP__c)) { |
| | | //加入共享 |
| | | Rental_Apply__Share ras = makeData(ra.Id,ra.Strategic_userFSESP__c); |
| | | addStrategList.add(ras); |
| | | } |
| | | //更新字段 |
| | | Rental_Apply__c rac = new Rental_Apply__c(); |
| | | rac.Id = ra.Id; |
| | | rac.hospitalLeaderSP__c = ra.Strategic_userFSESP__c; |
| | | raoList.add(rac); |
| | | |
| | | raMap.put(ra.Id,new Rental_Apply__c(id=ra.Id)); // 20220412 ljh add |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 start |
| | | //战略科室FSESP担当 发生变化,记录一下修改内容 |
| | | if(RentalApplyMapData.containsKey(ra.Id)){ |
| | |
| | | insRentalApplyShare.add(makeData3(newRA.id,userId)); |
| | | } |
| | | } |
| | | // 20220413 ljh update start |
| | | //修改备品的产品担当人字段值 |
| | | updateRac.add(new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c=productLeaderUserIdStr)); |
| | | // updateRac.add(new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c=productLeaderUserIdStr)); |
| | | raMap.put(newRA.id,new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c=productLeaderUserIdStr)); |
| | | // 20220413 ljh update end |
| | | } |
| | | } |
| | | }else{ |
| | | //如果 ProducLeader_Share__c 字段不为空,并且没有找到当前备品需要共享的产品担当人 |
| | | //证明以前共享了产品担当人,但是现在产品担当人做了修改(系统中没找到或此人已经通过其它共享原因共享了)或制空了,所以直接把以前共享的人删除掉就行 |
| | | delRentalApplyShare.add(newRA.id); |
| | | // 20220413 ljh update start |
| | | //修改备品的产品担当人字段值 |
| | | updateRac.add(new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c='')); |
| | | // updateRac.add(new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c='')); |
| | | raMap.put(newRA.id,new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c='')); |
| | | // 20220413 ljh update end |
| | | } |
| | | }else{ |
| | | //如果ProducLeader_Share__c字段为空,并且当前备品的产品担当人需要共享,那么就需要我们新增共享,并把共享人id,记录到当前备品上 |
| | |
| | | insRentalApplyShare.add(makeData3(newRA.id,userId)); |
| | | } |
| | | } |
| | | // 20220413 ljh update start |
| | | //修改备品的产品担当人字段值 |
| | | updateRac.add(new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c=productLeaderUserIdStr)); |
| | | // updateRac.add(new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c=productLeaderUserIdStr)); |
| | | raMap.put(newRA.id,new Rental_Apply__c(id=newRA.id,ProducLeader_Share__c=productLeaderUserIdStr)); |
| | | // 20220413 ljh update end |
| | | } |
| | | } |
| | | } |
| | |
| | | //如果没有产品当但人,但是字段不为空,那么证明,当前备品的产品担当人有变动值设置为空了,那么我们需要处理以前已经共享的产品担当人 |
| | | if(String.isNotBlank(ra.ProducLeader_Share__c)){ |
| | | delRentalApplyShare.add(ra.id); |
| | | // 20220413 ljh update start |
| | | //修改备品的产品担当人字段值 |
| | | updateRac.add(new Rental_Apply__c(id=ra.id,ProducLeader_Share__c='')); |
| | | // updateRac.add(new Rental_Apply__c(id=ra.id,ProducLeader_Share__c='')); |
| | | raMap.put(ra.Id,new Rental_Apply__c(id=ra.id,ProducLeader_Share__c='')); |
| | | // 20220413 ljh update end |
| | | } |
| | | } |
| | | } |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/15 end |
| | | } |
| | | //删除原来的共享 |
| | | delStrategList = [SELECT Id,ParentId,UserOrGroupId FROM Rental_Apply__Share WHERE RowCause ='Manual' AND ParentId in :ParentIdList AND UserOrGroupId in :UserOrGroupIdList]; |
| | | for(Integer m=0; m<delStrategList.size(); m++){ |
| | | if(String.isBlank(PUMap.get(delStrategList[m].ParentId))){ |
| | | delStrategList.remove(m); |
| | | } |
| | | } |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try{ |
| | | if(delStrategList.size()>0){ |
| | | delete delStrategList; |
| | | } |
| | | //增加 |
| | | if (addStrategList.size() > 0) { |
| | | insert addStrategList; |
| | | } |
| | | //更新备品借出 |
| | | if(raList.size()>0){ |
| | | update raList; |
| | | } |
| | | //更新备品借出GI |
| | | if (ratList.size() > 0) { |
| | | update ratList; |
| | | } |
| | | //更新备品借出SP |
| | | if (raoList.size() > 0) { |
| | | update raoList; |
| | | } |
| | | //add by rentx 2021-01-04 SFDC-BWQ3MX start |
| | | |
| | | try{ |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/18 start |
| | | //以下是备品借出申请的产品担当人共享 |
| | | //删除原来的产品担当共享人 |
| | |
| | | if(insRentalApplyShare != null && insRentalApplyShare.size() > 0){ |
| | | insert insRentalApplyShare; |
| | | } |
| | | // 20220413 ljh update start |
| | | //修改产品担当共享人 |
| | | if(updateRac != null && updateRac.size() > 0){ |
| | | update updateRac; |
| | | // if(updateRac != null && updateRac.size() > 0){ |
| | | // update updateRac; |
| | | // } |
| | | // System.debug('zheli:'+raMap.size()); |
| | | if(raMap != null && raMap.size() > 0){ |
| | | // System.debug('zheli:'+raMap.values()); |
| | | update raMap.values(); |
| | | } |
| | | // 20220413 ljh update end |
| | | //add wangweipeng 新增备品的产品担当人共享 2021/10/18 end |
| | | |
| | | }catch(Exception e){ |
| | |
| | | |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new ConsumablesApplyOrLendBatch(),1); |
| | | strategicDep[0].OwnerId = user[1].Id; |
| | | strategicDep[0].Department_Class_Label__c = '其他'; |
| | | update strategicDep; |
| | | Database.executeBatch(new ConsumablesApplyOrLendBatch(strategicDep[0].id),1); |
| | | // strategicDep[0].OwnerId = user[1].Id; |
| | | // strategicDep[0].Department_Class_Label__c = '其他'; |
| | | // update strategicDep; |
| | | // Database.executeBatch(new ConsumablesApplyOrLendBatch(strategicDep[0].id),1); |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | |
| | | List<User> user = [select Id,Name,Job_Category__c from User where IsActive = true AND Job_Category__c = '销售服务']; |
| | | // List<User> user1 = [select Id,Name from User where IsActive = true AND Job_Category__c = '销售服务']; |
| | | strategicDep[0].OwnerId = user[0].Id; |
| | | strategicDep[0].Department_Class_Label__c = '普外科'; |
| | | // strategicDep[0].Department_Class_Label__c = '普外科'; |
| | | update strategicDep; |
| | | |
| | | hospital.FSE_GI_Main_Leader__c = user[1].Id; |
| | |
| | | |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new ConsumablesApplyOrLendBatch(),1); |
| | | strategicDep[0].OwnerId = user[1].Id; |
| | | strategicDep[0].Department_Class_Label__c = '其他'; |
| | | update strategicDep; |
| | | Database.executeBatch(new ConsumablesApplyOrLendBatch(strategicDep[0].id),1); |
| | | // strategicDep[0].OwnerId = user[1].Id; |
| | | // strategicDep[0].Department_Class_Label__c = '其他'; |
| | | // update strategicDep; |
| | | // Database.executeBatch(new ConsumablesApplyOrLendBatch(strategicDep[0].id),1); |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | |
| | | insert ra1; |
| | | List<Rental_Apply__c> raList = [SELECT id,OwnerId,Approver_of_Service_Department__c,Strategic_user__c,Strategic_dept__c,ShareStrategicUser__c FROM Rental_Apply__c WHERE Id = :ra1.Id ]; |
| | | |
| | | strategicDep[0].OwnerId = u1.Id; |
| | | strategicDep[0].Department_Class_Label__c = '普外科'; |
| | | update strategicDep; |
| | | // strategicDep[0].OwnerId = u1.Id; |
| | | // strategicDep[0].Department_Class_Label__c = '普外科'; |
| | | // update strategicDep; |
| | | |
| | | |
| | | hospital.FSE_GI_Main_Leader__c = u2.Id; |
| | |
| | | @isTest |
| | | private class ContactHpDeptUpdTriggerTest { |
| | | |
| | | @TestSetup |
| | | static void makeData(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new String[]{'Contact','Agency_Contact__c'}); |
| | | } |
| | | |
| | | static testMethod void testUpdate() { |
| | | // recode type を取得 |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | |
| | | private Map < Id, Contact > oldMap; |
| | | private List < Contact > newList; |
| | | private List < Contact > oldList; |
| | | private Id AgencyId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); // 20220830 ljh LLIU-CHR8FF add |
| | | |
| | | public ContactTriggerHandler() { |
| | | this.newMap = (Map < Id, Contact > ) Trigger.newMap; |
| | | this.oldMap = (Map < Id, Contact > ) Trigger.oldMap; |
| | |
| | | syncToAgencyContact(); |
| | | updateDealerNum(); |
| | | sendToComPlat(); |
| | | updateChargeState();// 20220830 ljh LLIU-CHR8FF |
| | | } |
| | | |
| | | protected override void afterUpdate() { |
| | |
| | | } |
| | | // 服务技师 2018/12/24 end |
| | | private void syncToAgencyContact() { |
| | | System.debug('enter syncToAgencyContact'); |
| | | Map < Id, Agency_Contact__c > targetContactMap = new Map < Id, Agency_Contact__c > (); |
| | | Map < Id, Contact > ContactMap = new Map < Id, Contact > (); |
| | | for (Contact nObj: newList) { |
| | | if (nObj.RecordTypeId == '01210000000QfWdAAK' // Doctor |
| | | && |
| | |
| | | ) |
| | | ) { |
| | | //Agency_Contact__c acObj = new Agency_Contact__c(Agency_ID__c = '000000000000000', Contact__c = nObj.Id, ContactId18__c = nObj.Id, Agency_Hospital__c = null, Name = nObj.LastName + ((String.isBlank(nObj.FirstName) == false) ? ' ' + nObj.FirstName : ''), Department_Class__c = nObj.Strategic_dept_Class__c, Type__c = nObj.Type__c, Doctor_Division1__c = nObj.Doctor_Division1__c); |
| | | //zhj MEBG新方案改造 2022-11-27 去掉Encrypted start |
| | | Agency_Contact__c acObj = new Agency_Contact__c( |
| | | Agency_ID__c = '000000000000000', |
| | | Contact__c = nObj.Id, |
| | | ContactId18__c = nObj.Id, |
| | | Agency_Hospital__c = null, |
| | | Name = nObj.LastName, |
| | | Name_Encrypted__c = nObj.LastName_Encrypted__c, |
| | | //Name_Encrypted__c = nObj.LastName_Encrypted__c, |
| | | Department_Class__c = nObj.Strategic_dept_Class__c, |
| | | Type__c = nObj.Type__c, |
| | | Type_Encrypted__c = nObj.Type_Encrypted__c, |
| | | Doctor_Division1__c = nObj.Doctor_Division1__c, |
| | | Doctor_Division1_Encrypted__c = nObj.Doctor_Division1_Encrypted__c |
| | | //Type_Encrypted__c = nObj.Type_Encrypted__c, |
| | | Doctor_Division1__c = nObj.Doctor_Division1__c |
| | | //Doctor_Division1_Encrypted__c = nObj.Doctor_Division1_Encrypted__c |
| | | ); |
| | | //zhj MEBG新方案改造 2022-11-27 去掉Encrypted end |
| | | targetContactMap.put(nObj.Id, acObj); |
| | | ContactMap.put(nObj.Id, nObj); |
| | | } |
| | | } |
| | | } |
| | |
| | | List<Agency_Contact__c> temp = targetContactMap.values(); |
| | | upsert temp ContactId18__c; |
| | | system.debug('temp='+temp); |
| | | EncryptInsert(temp); |
| | | EncryptInsert(temp,ContactMap); |
| | | } |
| | | } |
| | | |
| | | static void EncryptInsert(List<Agency_Contact__c> aclist){ |
| | | static void EncryptInsert(List<Agency_Contact__c> aclist,Map < Id, Contact > ContactMap){ |
| | | if(!(system.isFuture() || system.isBatch())){ |
| | | AwsServiceTool2.EncryptPushFuture(Json.serialize(aclist), 'Agency_Contact__c'); |
| | | //zhj MEBG新方案改造 2022-11-27 start |
| | | //AwsServiceTool2.EncryptPushFuture(Json.serialize(aclist), 'Agency_Contact__c'); |
| | | |
| | | Map<String,PIHelper.PIIntegration> staticResource = new Map<String,PIHelper.PIIntegration>(); |
| | | staticResource.put('Contact',PIHelper.getPIIntegrationInfo('Contact')); |
| | | staticResource.put('Agency_Contact__c',PIHelper.getPIIntegrationInfo('Agency_Contact__c')); |
| | | Map<String, Map<String, PI_Field_Policy_Detail__c>> mmsp = new Map<String, Map<String,PI_Field_Policy_Detail__c>>(); |
| | | for (String key : staticResource.keySet()) { |
| | | mmsp.put(key, new Map<String,PI_Field_Policy_Detail__c>()); |
| | | for (PI_Field_Policy_Detail__c detail : staticResource.get(key).PIDetails) { |
| | | mmsp.get(key).put(detail.SF_Field_API_Name__c, detail); |
| | | } |
| | | } |
| | | |
| | | System.debug('mmsp = ' + mmsp); |
| | | List<AWSServiceTool2V2.EncryptPushRequestBody> EncryptPushList = new List<AWSServiceTool2V2.EncryptPushRequestBody>(); |
| | | for(Agency_Contact__c ac : aclist){ |
| | | AWSServiceTool2V2.EncryptPushRequestBody EncryptPush = new AWSServiceTool2V2.EncryptPushRequestBody(); |
| | | EncryptPush.dataId = ac.AWS_Data_Id__c != null ?ac.AWS_Data_Id__c:''; |
| | | EncryptPush.sfRecordId = ac.Id; |
| | | EncryptPush.fieldsMapping = new Map<String, List<AWSServiceTool2V2.EncryptPushRes>>(); |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res= new AWSServiceTool2V2.EncryptPushRes(); |
| | | res.isQueryDb = true; |
| | | res.value = ''; |
| | | res.table = staticResource.get('Contact').awsTableName; |
| | | res.dataId = ContactMap.get(ac.Contact__c).AWS_Data_Id__c; |
| | | res.field = mmsp.get('Contact').get('LastName').AWS_Field_API__c; |
| | | resList.add(res); |
| | | |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList2 = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res2= new AWSServiceTool2V2.EncryptPushRes(); |
| | | res2.isQueryDb = true; |
| | | res2.value = ''; |
| | | res2.table = staticResource.get('Contact').awsTableName; |
| | | res2.dataId = ContactMap.get(ac.Contact__c).AWS_Data_Id__c; |
| | | res2.field = mmsp.get('Contact').get('Type__c').AWS_Field_API__c; |
| | | resList2.add(res2); |
| | | |
| | | List<AWSServiceTool2V2.EncryptPushRes> resList3 = new List<AWSServiceTool2V2.EncryptPushRes>(); |
| | | AWSServiceTool2V2.EncryptPushRes res3= new AWSServiceTool2V2.EncryptPushRes(); |
| | | res3.isQueryDb = true; |
| | | res3.value = ''; |
| | | res3.table = staticResource.get('Contact').awsTableName; |
| | | res3.dataId = ContactMap.get(ac.Contact__c).AWS_Data_Id__c; |
| | | res3.field = mmsp.get('Contact').get('Doctor_Division1__c').AWS_Field_API__c; |
| | | resList3.add(res3); |
| | | |
| | | System.debug('Agency_Contact__c Name = ' +mmsp.get('Agency_Contact__c').get('Name').AWS_Field_API__c); |
| | | System.debug('resList = ' + resList); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Agency_Contact__c').get('Name').AWS_Field_API__c, resList); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Agency_Contact__c').get('Type__c').AWS_Field_API__c, resList2); |
| | | EncryptPush.fieldsMapping.put(mmsp.get('Agency_Contact__c').get('Doctor_Division1__c').AWS_Field_API__c, resList3); |
| | | EncryptPushList.add(EncryptPush); |
| | | } |
| | | System.debug('EncryptPushListdataId = ' + JSON.serialize(EncryptPushList[0].dataId)); |
| | | System.debug('EncryptPushListsfRecordId = ' + JSON.serialize(EncryptPushList[0].sfRecordId)); |
| | | System.debug('EncryptPushListfieldsMapping = ' + JSON.serialize(EncryptPushList[0].fieldsMapping)); |
| | | System.debug('EncryptPushList = ' + JSON.serialize(EncryptPushList)); |
| | | if(!Test.isRunningTest()) |
| | | AwsServiceTool2V2.EncryptPushFutureV2(Json.serialize(EncryptPushList),Json.serialize(aclist), 'Agency_Contact__c'); |
| | | //zhj MEBG新方案改造 2022-11-27 end |
| | | }else{ |
| | | //Add By Li Jun for sync agency contact to aws 20220424 start |
| | | if(!Test.isRunningTest()){ |
| | | SyncAccountContactToAWS.assignOnceOneMinuteLater(aclist); |
| | | System.debug('ContactMap = ' + ContactMap); |
| | | SyncAccountContactToAWS.assignOnceOneMinuteLater(aclist,ContactMap); |
| | | } |
| | | //Add By Li Jun for sync agency contact to aws 20220424 end |
| | | } |
| | |
| | | } |
| | | //更新经销商用户人数字段 精琢技术 pk 2021-08-26 end |
| | | |
| | | //zhj 新方案改造 将手机号去重及其验证规则移动到AWS和前端 start |
| | | // 手机号去重及规则验证 及新增客户人员重名验证 |
| | | public void mobileNumberVerification(){ |
| | | |
| | |
| | | contactnew.UniqueNumber__c = null; |
| | | } |
| | | // 经销商客户人员不进行手机号校验 thh 20220517 end |
| | | } else if(DoctorRecordTypeId.equals(contactnew.RecordTypeId)){ |
| | | if(String.isNotBlank(contactnew.MobilePhone_Encrypted__c)){ |
| | | contactnew.UniqueNumber__c = contactnew.MobilePhone_Encrypted__c; |
| | | } else { |
| | | contactnew.UniqueNumber__c = null; |
| | | } |
| | | } |
| | | } |
| | | // else if(DoctorRecordTypeId.equals(contactnew.RecordTypeId)){ |
| | | // if(String.isNotBlank(contactnew.MobilePhone_Encrypted__c)){ |
| | | // contactnew.UniqueNumber__c = contactnew.MobilePhone_Encrypted__c; |
| | | // } else { |
| | | // contactnew.UniqueNumber__c = null; |
| | | // } |
| | | // } |
| | | } |
| | | // if (Trigger.isInsert) { |
| | | if(DoctorRecordTypeId.equals(contactnew.RecordTypeId)){ |
| | | accountIdSet.add(contactnew.AccountId); |
| | | } |
| | | // if(DoctorRecordTypeId.equals(contactnew.RecordTypeId)){ |
| | | // accountIdSet.add(contactnew.AccountId); |
| | | // } |
| | | // } |
| | | } |
| | | //手机号唯一校验-医院下新建客户人员校验使用加密手机号,经销商使用普通手机号 thh 20220328 end |
| | | // 新增医院联系人时 |
| | | if (accountIdSet.size() > 0) { |
| | | List<Contact> contactList = new List<Contact>(); |
| | | if(Trigger.isInsert){ |
| | | contactList = [SELECT Id,AccountId,FullName__c,LastName,FirstName,Account.Name,CManageCode__c,IsFromSPO__c, |
| | | LastName_Encrypted__c// 20220314 PI改造 by Bright |
| | | , MobilePhone_Encrypted__c // 通过姓名+手机号判断人员是否重复 thh 20220518 |
| | | FROM Contact |
| | | WHERE IsFromSPO__c = false AND AccountId IN:accountIdSet]; |
| | | } |
| | | if(Trigger.isUpdate){ |
| | | contactList = [SELECT Id,AccountId,FullName__c,LastName,FirstName,Account.Name,CManageCode__c,IsFromSPO__c, |
| | | LastName_Encrypted__c// 20220314 PI改造 by Bright |
| | | , MobilePhone_Encrypted__c // 通过姓名+手机号判断人员是否重复 thh 20220518 |
| | | FROM Contact |
| | | WHERE IsFromSPO__c = false AND AccountId IN:accountIdSet AND Id Not IN: oldMap.keyset()]; |
| | | } |
| | | System.debug('contactList:' + contactList); |
| | | if (contactList.size() > 0) { |
| | | for(Contact contact :contactList){ |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // String lastNameStr = String.isNotBlank(contact.LastName) ? contact.LastName:''; |
| | | // String firstNameStr = String.isNotBlank(contact.FirstName) ? contact.FirstName:''; |
| | | // String contactFullName = lastNameStr + firstNameStr + MobilePhoneStr; |
| | | String contactFullName = contact.LastName_Encrypted__c + contact.MobilePhone_Encrypted__c;// 20220314 PI改造 by Bright |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | if(string.isBlank(contactFullName)){ |
| | | continue; |
| | | } |
| | | String accountId = String.valueOf(contact.AccountId).SubString(0,15); |
| | | Map<String,Contact> contactFullNameMap = new Map<String,Contact>(); |
| | | if (accountContactMap.containsKey(accountId)) { |
| | | contactFullNameMap = accountContactMap.get(accountId); |
| | | } |
| | | contactFullNameMap.put(contactFullName, contact); |
| | | accountContactMap.put(accountId, contactFullNameMap); |
| | | } |
| | | } |
| | | } |
| | | // if (accountIdSet.size() > 0) { |
| | | // List<Contact> contactList = new List<Contact>(); |
| | | // if(Trigger.isInsert){ |
| | | // contactList = [SELECT Id,AccountId,FullName__c,LastName,FirstName,Account.Name,CManageCode__c,IsFromSPO__c, |
| | | // LastName_Encrypted__c// 20220314 PI改造 by Bright |
| | | // , MobilePhone_Encrypted__c // 通过姓名+手机号判断人员是否重复 thh 20220518 |
| | | // FROM Contact |
| | | // WHERE IsFromSPO__c = false AND AccountId IN:accountIdSet]; |
| | | // } |
| | | // if(Trigger.isUpdate){ |
| | | // contactList = [SELECT Id,AccountId,FullName__c,LastName,FirstName,Account.Name,CManageCode__c,IsFromSPO__c, |
| | | // LastName_Encrypted__c// 20220314 PI改造 by Bright |
| | | // , MobilePhone_Encrypted__c // 通过姓名+手机号判断人员是否重复 thh 20220518 |
| | | // FROM Contact |
| | | // WHERE IsFromSPO__c = false AND AccountId IN:accountIdSet AND Id Not IN: oldMap.keyset()]; |
| | | // } |
| | | // System.debug('contactList:' + contactList); |
| | | // if (contactList.size() > 0) { |
| | | // for(Contact contact :contactList){ |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // // String lastNameStr = String.isNotBlank(contact.LastName) ? contact.LastName:''; |
| | | // // String firstNameStr = String.isNotBlank(contact.FirstName) ? contact.FirstName:''; |
| | | // // String contactFullName = lastNameStr + firstNameStr + MobilePhoneStr; |
| | | // String contactFullName = contact.LastName_Encrypted__c + contact.MobilePhone_Encrypted__c;// 20220314 PI改造 by Bright |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | // if(string.isBlank(contactFullName)){ |
| | | // continue; |
| | | // } |
| | | // String accountId = String.valueOf(contact.AccountId).SubString(0,15); |
| | | // Map<String,Contact> contactFullNameMap = new Map<String,Contact>(); |
| | | // if (accountContactMap.containsKey(accountId)) { |
| | | // contactFullNameMap = accountContactMap.get(accountId); |
| | | // } |
| | | // contactFullNameMap.put(contactFullName, contact); |
| | | // accountContactMap.put(accountId, contactFullNameMap); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | for (Contact contactnew: newList) { |
| | | if(AgencyRecordTypeId.equals(contactnew.RecordTypeId) || (Trigger.isUpdate && !oldMap.isEmpty() && oldMap.get(contactnew.Id) != null |
| | | && String.isBlank(oldMap.get(contactnew.Id).MobilePhone_Encrypted__c) |
| | | && String.isBlank(contactnew.MobilePhone_Encrypted__c))){ |
| | | continue; |
| | | } |
| | | String accountId = String.valueOf(contactnew.AccountId).substring(0, 15); |
| | | if (accountContactMap.containsKey(accountId)) { |
| | | Map<String,Contact> contactFullNameMap = accountContactMap.get(accountId); |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // String lastNameStr = String.isNotBlank(contactnew.LastName) ? contactnew.LastName:''; |
| | | // String firstNameStr = String.isNotBlank(contactnew.FirstName) ? contactnew.FirstName:''; |
| | | // String contactFullName = lastNameStr + firstNameStr + MobilePhoneStr; |
| | | String contactFullName = contactnew.LastName_Encrypted__c + contactnew.MobilePhone_Encrypted__c;// 20220314 PI改造 by Bright |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | if (contactFullNameMap.containsKey(contactFullName)) { |
| | | String accountName = contactFullNameMap.get(contactFullName).Account.Name; |
| | | String cManageCode = contactFullNameMap.get(contactFullName).CManageCode__c; |
| | | // 跳过测试程序 和 SPO通过203接口创建的联系人 |
| | | if (!(Test.isRunningTest() || contactnew.IsFromSPO__c)) { |
| | | // if(Trigger.isInsert) { |
| | | contactnew.LastName.addError('客户 [ '+accountName+ ' ],已存在相同名字的联系人 人员管理编码 ['+cManageCode+' ] ,不能重复创建,请了解'); |
| | | // } |
| | | // 客户人员删除手机号时,进行判断是否存在同名且手机号为空的客户人员 thh 20220523 start |
| | | // if(Trigger.isUpdate && !UserInfo.getUserId().equals(System.Label.interfaceUserID)) { |
| | | // if (String.isNotBlank(oldMap.get(contactnew.Id).MobilePhone_Encrypted__c) && String.isBlank(contactnew.MobilePhone_Encrypted__c)){ |
| | | // contactnew.LastName.addError('相同名字的联系人 人员管理编码 ['+cManageCode+' ] 手机号为空已经存在,不能重复创建,请了解'); |
| | | // } |
| | | // if (oldMap.get(contactnew.Id).CManageCode__c != contactnew.CManageCode__c){ |
| | | // contactnew.LastName.addError('客户 [ '+accountName+ ' ],已存在相同名字的联系人 人员管理编码 ['+cManageCode+' ] ,不能重复创建,请了解'); |
| | | // } |
| | | // } |
| | | // 客户人员删除手机号时,进行判断是否存在同名且手机号为空的客户人员 thh 20220523 end |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // for (Contact contactnew: newList) { |
| | | // if(AgencyRecordTypeId.equals(contactnew.RecordTypeId) || (Trigger.isUpdate && !oldMap.isEmpty() && oldMap.get(contactnew.Id) != null |
| | | // && String.isBlank(oldMap.get(contactnew.Id).MobilePhone_Encrypted__c) |
| | | // && String.isBlank(contactnew.MobilePhone_Encrypted__c))){ |
| | | // continue; |
| | | // } |
| | | // String accountId = String.valueOf(contactnew.AccountId).substring(0, 15); |
| | | // if (accountContactMap.containsKey(accountId)) { |
| | | // Map<String,Contact> contactFullNameMap = accountContactMap.get(accountId); |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // // String lastNameStr = String.isNotBlank(contactnew.LastName) ? contactnew.LastName:''; |
| | | // // String firstNameStr = String.isNotBlank(contactnew.FirstName) ? contactnew.FirstName:''; |
| | | // // String contactFullName = lastNameStr + firstNameStr + MobilePhoneStr; |
| | | // String contactFullName = contactnew.LastName_Encrypted__c + contactnew.MobilePhone_Encrypted__c;// 20220314 PI改造 by Bright |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | // if (contactFullNameMap.containsKey(contactFullName)) { |
| | | // String accountName = contactFullNameMap.get(contactFullName).Account.Name; |
| | | // String cManageCode = contactFullNameMap.get(contactFullName).CManageCode__c; |
| | | // // 跳过测试程序 和 SPO通过203接口创建的联系人 |
| | | // if (!(Test.isRunningTest() || contactnew.IsFromSPO__c)) { |
| | | // // if(Trigger.isInsert) { |
| | | // contactnew.LastName.addError('客户 [ '+accountName+ ' ],已存在相同名字的联系人 人员管理编码 ['+cManageCode+' ] ,不能重复创建,请了解'); |
| | | // // } |
| | | // // 客户人员删除手机号时,进行判断是否存在同名且手机号为空的客户人员 thh 20220523 start |
| | | // // if(Trigger.isUpdate && !UserInfo.getUserId().equals(System.Label.interfaceUserID)) { |
| | | // // if (String.isNotBlank(oldMap.get(contactnew.Id).MobilePhone_Encrypted__c) && String.isBlank(contactnew.MobilePhone_Encrypted__c)){ |
| | | // // contactnew.LastName.addError('相同名字的联系人 人员管理编码 ['+cManageCode+' ] 手机号为空已经存在,不能重复创建,请了解'); |
| | | // // } |
| | | // // if (oldMap.get(contactnew.Id).CManageCode__c != contactnew.CManageCode__c){ |
| | | // // contactnew.LastName.addError('客户 [ '+accountName+ ' ],已存在相同名字的联系人 人员管理编码 ['+cManageCode+' ] ,不能重复创建,请了解'); |
| | | // // } |
| | | // // } |
| | | // // 客户人员删除手机号时,进行判断是否存在同名且手机号为空的客户人员 thh 20220523 end |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | //zhj 新方案改造 将手机号去重及其验证规则移动到AWS和前端 end |
| | | |
| | | public static Map<Id,Id> NFM606_IdMap = new Map<Id,Id>(); |
| | | // 606接口调用问题修复 thh 20220330 start |
| | | private void sendToComPlat() { |
| | |
| | | || old.ServicePlatformCode__c != local.ServicePlatformCode__c//服务平台编码 |
| | | || old.UnifiedI_Contact_ID__c != local.UnifiedI_Contact_ID__c//智慧医疗编码 |
| | | || old.ContactType__c != local.ContactType__c//人员类型 |
| | | |
| | | || (old.ChargeState__c != local.ChargeState__c && local.RecordTypeId == AgencyId)//负责省 // 20220830 ljh LLIU-CHR8FF add |
| | | ) { |
| | | //获取客户人员的记录类型ID thh 20220330 start |
| | | ID InternalStaffRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Internal_staff').getRecordTypeId(); |
| | |
| | | //获取客户人员的记录类型ID thh 20220330 end |
| | | System.debug('local.UnifiedI_Contact_ID__c1:' + local.UnifiedI_Contact_ID__c); |
| | | System.debug('local.MobilePhone1:' + local.MobilePhone); |
| | | if (!local.IsFromSPO__c && !InternalStaffRecordTypeId.equals(local.RecordTypeId)) { |
| | | // gzw 20220824 bugfix start |
| | | // if (!local.IsFromSPO__c && !InternalStaffRecordTypeId.equals(local.RecordTypeId)) { |
| | | if (!InternalStaffRecordTypeId.equals(local.RecordTypeId)) { |
| | | // gzw 20220824 bugfix end |
| | | // 医院 客户人员 统一平台编码有值 发送 PO |
| | | if (DoctorRecordTypeId.equals(local.RecordTypeId) && String.isNotBlank(local.UnifiedI_Contact_ID__c)) { |
| | | if (!NFM606_IdMap.containsKey(local.Id)) { |
| | |
| | | } |
| | | } |
| | | // 606接口调用问题修复 thh 20220330 end |
| | | // 20220830 ljh LLIU-CHR8FF add start |
| | | private void updateChargeState(){ |
| | | List<Contact> contactL = new List<Contact>(); |
| | | for (Contact nObj : newList) { |
| | | if(nObj.RecordTypeId == AgencyId && String.isBlank(nObj.ChargeState__c)){ |
| | | Contact cnew = new Contact(); |
| | | cnew.Id = nObj.Id; |
| | | cnew.ChargeState__c = nObj.ChargeState_F__c; |
| | | contactL.add(cnew); |
| | | } |
| | | } |
| | | if (!contactL.isEmpty()) { |
| | | update contactL; |
| | | } |
| | | } |
| | | // 20220830 ljh LLIU-CHR8FF add end |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @Testsetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c'); |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Agency_Contact__c'); |
| | | strList.add('Agency_Contact__cV2'); |
| | | strList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | //TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c'); |
| | | |
| | | } |
| | | @isTest static void test_method_one() { |
| | |
| | | Visitor1__c, Visitor2__c, Visitor3__c, Visitor4__c, Visitor5__c, Visitor1_ID__c, Visitor2_ID__c, Visitor3_ID__c, Visitor4_ID__c, Visitor5_ID__c, |
| | | Purpose_Type__c, Location, Related_Opportunity1__c, Related_Service1__c, Related_Opportunity1_ID__c, Related_Service1_ID__c, WS_flg__c, |
| | | Related_Opportunity2__c, Related_Opportunity3__c, Related_Opportunity4__c, Related_Opportunity5__c,OPDPlan_Flag__c, |
| | | Related_Opportunity2_ID__c, Related_Opportunity3_ID__c, Related_Opportunity4_ID__c, Related_Opportunity5_ID__c, |
| | | Related_Opportunity2_ID__c, Related_Opportunity3_ID__c, Related_Opportunity4_ID__c, Related_Opportunity5_ID__c,Opd_Plan__c, |
| | | Activity_Purpose__c, Activity_PurposeFSE__c, Activity_PurposeEscFSE__c, Purpose_TypeFSE__c, Purpose_TypeEscFSE__c,EventStatus__c,cancelReason__c,cancelReasonOther__c,cancelReasonSelect__c,cancelReasonSelectFSE__c,delayReason__c,delayReasonOther__c,delayReasonSelect__c,delayReasonSelectFSE__c,delayToDate__c |
| | | from Event where WS_flg__c = false and ActivityDate = :whereDate and OwnerId = :ur.Id and EventStatus__c not in ('04 取消','05 延期','06 关闭','07 未执行') order by StartDateTime]; |
| | | return calenderList; |
| | |
| | | return new Map<Id, Contact>([Select Id, User__c From Contact Where Id IN: contactIds and User__r.isActive = true]); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * add 2021/12/23 wangweipeng satrt |
| | | * [updateFutureOds 更新ods的user__c字段] |
| | |
| | | } |
| | | //@future |
| | | public static void upsertFutureContactInterface(List<String> userEmployeeNoList) { |
| | | |
| | | // 社内员工のレコードタイプ |
| | | Id rtId = '01210000000Qtky'; |
| | | // 现有联系人 |
| | | Map<String, Contact> conMap = new Map<String, Contact>(); |
| | | // UserToContact の 変更したか にて判断した項目です |
| | | List<User> usrList = [select Id, Notes_File_Name__c,FirstName, LastName, Email, Mobile_Phone__c, Employee_No__c, Work_Location__c, Post__c, Job_Category__c, Hire_Date__c, Gender__c, Dept__c, Pregnant_Rest__c, Salesdepartment__c, Stay_or_not__c,IsMEBG__c, Work_Location_HR__c from User where Employee_No__c IN :userEmployeeNoList]; |
| | | //20220425 LLIU-CCY9TA you 查询post的地方换成 HR_Post__c |
| | | List<User> usrList = [select Id,PositionSubsequence__c,Rank__c, Notes_File_Name__c,FirstName, LastName, Email, Mobile_Phone__c, Employee_No__c, Work_Location__c, HR_Post__c,Post__c, Job_Category__c, Hire_Date__c, Gender__c, Dept__c, Pregnant_Rest__c, Salesdepartment__c, Stay_or_not__c,IsMEBG__c, Work_Location_HR__c from User where Employee_No__c IN :userEmployeeNoList]; |
| | | List<Contact> conList = [select Id,Notes_File_Name__c, User__c, Employee_No_manual__c,Isactive__c,IsMEBG__c, Work_Location_HR__c from Contact where Employee_No_manual__c IN :userEmployeeNoList and RecordTypeId = :rtId]; |
| | | for (Contact con : conList) { |
| | | //conMap.put(con.Employee_No_manual__c, con); |
| | | conMap.put(con.Employee_No_manual__c.toLowerCase(), con); |
| | | } |
| | | system.debug('youchangtest1'); |
| | | List<Contact> upsertList = new List<Contact>(); |
| | | for (User local : usrList) { |
| | | //update wangweipeng 2021/11/19 |
| | |
| | | //用户的工作地(人事)改变更新到联系人上 thh 2022-02-16 start |
| | | tmp.Work_Location_HR__c = local.Work_Location_HR__c; |
| | | //用户的工作地(人事)改变更新到联系人上 thh 2022-02-16 end |
| | | tmp.Post_picklist__c = local.Post__c; |
| | | tmp.Post_picklist__c = local.Post__c; //20220426 LLIU-CCY9TA you用户的 Post__c ,还是对应联系人 |
| | | tmp.HR_Post__c = local.HR_Post__c;//HR通用职级 //20220425 LLIU-CCY9TA you |
| | | tmp.Job_Category_picklist__c = local.Job_Category__c; |
| | | tmp.Hire_date_text__c = local.Hire_Date__c; |
| | | tmp.Gender_text__c = local.Gender__c; |
| | |
| | | tmp.Salesdepartment_Text__c = local.Salesdepartment__c; |
| | | tmp.Stay_or_not__c = local.Stay_or_not__c; |
| | | tmp.IsMEBG__c = local.IsMEBG__c;//是否MEBG |
| | | //20220428 LLIU-CDW5ZW you start |
| | | tmp.PositionSubsequence__c = local.PositionSubsequence__c; |
| | | //20220428 LLIU-CDW5ZW you end |
| | | //20220512 you LLIU-CDW5ZW start |
| | | tmp.Rank__c = local.Rank__c; |
| | | //20220428 you LLIU-CDW5ZW end |
| | | |
| | | if(String.isNotBlank(local.Stay_or_not__c)){ |
| | | tmp.Isactive__c = local.Stay_or_not__c == '在职' ? '有效':'无效'; |
| | | tmp.Isactive__c = local.Stay_or_not__c == '在职' ? '有效':'无效(退休)'; |
| | | } |
| | | upsertList.add(tmp); |
| | | system.debug('youchangtest2'+tmp.HR_Post__c); |
| | | } else { |
| | | // 新做联系人 |
| | | Contact tmp = new Contact(); |
| | |
| | | tmp.Work_Location_HR__c = local.Work_Location__c; |
| | | tmp.Work_Location_picklist__c = local.Work_Location__c; |
| | | //如果根据HR信息新建用户,则把HR信息的工作地传给用户的工作地和工作地(人事) thh 2022-02-16 end |
| | | tmp.Post_picklist__c = local.Post__c; |
| | | tmp.Post_picklist__c = local.Post__c;//20220426 LLIU-CCY9TA you用户的 Post__c ,还是对应联系人 |
| | | tmp.HR_Post__c = local.HR_Post__c;//HR通用职级 //20220425 LLIU-CCY9TA you |
| | | tmp.Job_Category_picklist__c = local.Job_Category__c; |
| | | tmp.Hire_date_text__c = local.Hire_Date__c; |
| | | tmp.Gender_text__c = local.Gender__c; |
| | |
| | | tmp.Salesdepartment_Text__c = local.Salesdepartment__c; |
| | | tmp.Stay_or_not__c = local.Stay_or_not__c; |
| | | tmp.IsMEBG__c = local.IsMEBG__c;//是否MEBG |
| | | //20220428 LLIU-CDW5ZW you start |
| | | tmp.PositionSubsequence__c = local.PositionSubsequence__c; |
| | | //20220428 LLIU-CDW5ZW you end |
| | | //20220512 you LLIU-CDW5ZW start |
| | | tmp.Rank__c = local.Rank__c; |
| | | //20220428 you LLIU-CDW5ZW end |
| | | if(String.isNotBlank(local.Stay_or_not__c)){ |
| | | tmp.Isactive__c = '在职'.equals(local.Stay_or_not__c) ? '有效':'无效'; |
| | | tmp.Isactive__c = '在职'.equals(local.Stay_or_not__c) ? '有效':'无效(退休)'; |
| | | } |
| | | upsertList.add(tmp); |
| | | system.debug('youchangtest3'+tmp.HR_Post__c); |
| | | } |
| | | } |
| | | upsert upsertList; |
| | | } |
| | | |
| | | // 20220425 you 经查看 此对象应该是没有任何地方用到了,可以注释掉 |
| | | public static void updateFutureUserByContact(List<String> userEmployeeNoList) { |
| | | // 现有用户 |
| | | Map<String, User> usrMap = new Map<String, User>(); |
| | |
| | | //add wangweipeng 2021/11/18 start |
| | | //根据ods的员工编码,更新或新增 user表的数据 |
| | | public static void updateFutureOdsByUser(List<String> userEmployeeNoList) { |
| | | //20220426 LLIU-CCY9TA you start 通用职衔和user上的职位互相映射, |
| | | SS_BatchColumnMapping__c mpdMapping = SS_BatchColumnMapping__c.getValues('HR_Post_To_UserAndContact__c'); |
| | | |
| | | Map<String,String> UserAndContactMap = new Map<String,String>(); |
| | | for (Integer i = 1; i <= 30; i++) { |
| | | String lpadI = ('00' + i).right(3); |
| | | String fromColumn = 'From_Column_' + lpadI + '__c'; |
| | | if(mpdMapping!=null){ |
| | | String apiStr = String.valueOf(mpdMapping.get(fromColumn)); |
| | | if (String.isBlank(apiStr) == false) { |
| | | String ssColumn = 'SS_Column_' + lpadI + '__c'; |
| | | String ssApiStr = String.valueOf(mpdMapping.get(ssColumn)); |
| | | UserAndContactMap.put(apiStr,ssApiStr); |
| | | } |
| | | } |
| | | } |
| | | //20220426 LLIU-CCY9TA you end |
| | | |
| | | //20220721 you LLIU-CGH8EY start 本部分类-岗位子序列,映射 user上的职种 |
| | | SS_BatchColumnMapping__c JobmpdMapping = SS_BatchColumnMapping__c.getValues('HR_Post_To_Job_Category__c'); |
| | | |
| | | Map<String,String> Job_CategoryMap = new Map<String,String>(); |
| | | for (Integer i = 1; i <= 30; i++) { |
| | | String lpadI = ('00' + i).right(3); |
| | | String fromColumn = 'From_Column_' + lpadI + '__c'; |
| | | if(JobmpdMapping!=null){ |
| | | String apiStr = String.valueOf(JobmpdMapping.get(fromColumn)); |
| | | if (String.isBlank(apiStr) == false) { |
| | | String ssColumn = 'SS_Column_' + lpadI + '__c'; |
| | | String ssApiStr = String.valueOf(JobmpdMapping.get(ssColumn)); |
| | | Job_CategoryMap.put(apiStr,ssApiStr); |
| | | } |
| | | } |
| | | } |
| | | //20220721 you LLIU-CGH8EY end |
| | | |
| | | //20220823 you LLIU-CHL8FB start 本部是--solution本部的通过映射,更新用户上的 本部(选项),如果是其他,那么正常走逻辑 |
| | | SS_BatchColumnMapping__c DeptMapping = SS_BatchColumnMapping__c.getValues('HR_Category4_To_Dept__c'); |
| | | |
| | | Map<String,String> DeptMap = new Map<String,String>(); |
| | | for (Integer i = 1; i <= 30; i++) { |
| | | String lpadI = ('00' + i).right(3); |
| | | String fromColumn = 'From_Column_' + lpadI + '__c'; |
| | | if(DeptMapping!=null){ |
| | | String apiStr = String.valueOf(DeptMapping.get(fromColumn)); |
| | | if (String.isBlank(apiStr) == false) { |
| | | String ssColumn = 'SS_Column_' + lpadI + '__c'; |
| | | String ssApiStr = String.valueOf(DeptMapping.get(ssColumn)); |
| | | DeptMap.put(apiStr,ssApiStr); |
| | | } |
| | | } |
| | | } |
| | | //20220823 you LLIU-CHL8FB end |
| | | |
| | | system.debug(mpdMapping+'==UserAndContactMap=='+UserAndContactMap); |
| | | //获取自定义标签,自己定义,用来空更新数据或处理历史数据 |
| | | //在处理历史记录时:职位和职种 如果ods的值为空,那么user对象的这两个字段就不需要更新 |
| | | Integer buffer = Integer.valueOf(System.Label.ODS_Null_Update_Sign); |
| | | // 现有用户 |
| | | Map<String, User> usrMap = new Map<String, User>(); |
| | | // ContactToUser の 変更したか にて判断した項目です |
| | | List<ODS__c> conList = [select id,Alias__c,Branch__c,Category3__c,Category4__c,Category5__c,Category6__c,Employee_No__c,Hire_Date__c,FirstName__c,LastName__c,Name__c,Email__c,MobilePhone__c,Post__c,Job_Category__c,Job_Type__c,Product_specialist_incharge_product__c,Sales_Speciality__c,Work_Location__c,Stay_or_not__c,LeaveDate__c,UniqueId__c,Null_Update__c from ODS__c where Employee_No__c in :userEmployeeNoList]; |
| | | List<ODS__c> conList = [select id,Alias__c,Branch__c,PositionSubsequence__c,Rank__c,Category3__c,Category4__c,Category5__c,Category6__c,Employee_No__c,Hire_Date__c,FirstName__c,LastName__c,Name__c,Email__c,MobilePhone__c,Post__c,Job_Category__c,Job_Type__c,Product_specialist_incharge_product__c,Sales_Speciality__c,Work_Location__c,Stay_or_not__c,LeaveDate__c,UniqueId__c,Null_Update__c,Salesdepartment__c from ODS__c where Employee_No__c in :userEmployeeNoList]; |
| | | |
| | | List<User> usrList = [select Id, PBI_Enable__c ,PBIAuthorizedSetting__c,Employee_No__c from User where Employee_No__c IN :userEmployeeNoList]; |
| | | for (User usr : usrList) { |
| | |
| | | |
| | | userData.Group_sales_dept__c = odsc.Category3__c;//统括本部 |
| | | if(String.isNotBlank(odsc.Category4__c)){ |
| | | userData.Dept__c = odsc.Category4__c;//本部 |
| | | //20220823 you LLIU-CHL8FB start |
| | | if(null!=DeptMap && DeptMap.containsKey(odsc.Category4__c)){ |
| | | userData.Dept__c = DeptMap.get(odsc.Category4__c);//本部 |
| | | }else{ |
| | | userData.Dept__c = odsc.Category4__c;//本部 |
| | | } |
| | | //20220823 you LLIU-CHL8FB end |
| | | } |
| | | userData.Category5__c = odsc.Category5__c;//部 |
| | | //LLIU-CCS8ZB-当新创建的时候接收人事信息中的课信息,之后不进行更新 thh 20220324 start |
| | |
| | | //userData.Email = odsc.Email__c;//电子邮件 |
| | | userData.Mobile_Phone__c = odsc.MobilePhone__c;//手机号码 |
| | | //如果自定义变迁的值为1,那么证明现在是在处理历史数据,而历史数据规定,如果ods的职位为空,那么就不需要更新user的职种 |
| | | //20220425 LLIU-CCY9TA you ods 的 通用职衔 对应用户上新创建的 HR通用职级 断开跟职位的关系 |
| | | |
| | | if(String.isNotBlank(odsc.Post__c) || buffer != 1){ |
| | | userData.Post__c = odsc.Post__c;//职位 |
| | | //userData.Post__c = odsc.Post__c;//职位 |
| | | userData.HR_Post__c = odsc.Post__c;//HR通用职级 |
| | | system.debug(odsc.Post__c+'===='+UserAndContactMap.containsKey(odsc.Post__c)); |
| | | if(null!=UserAndContactMap && UserAndContactMap.containsKey(odsc.Post__c)){ |
| | | userData.Post__c = UserAndContactMap.get(odsc.Post__c); |
| | | } |
| | | } |
| | | //20220426 LLIU-CCY9TA you end |
| | | |
| | | //20220428 LLIU-CDW5ZW you start |
| | | userData.PositionSubsequence__c = odsc.PositionSubsequence__c; |
| | | //20220428 LLIU-CDW5ZW you end |
| | | //20220512 you LLIU-CDW5ZW start |
| | | userData.Rank__c = odsc.Rank__c; |
| | | //20220428 you LLIU-CDW5ZW end |
| | | |
| | | // 20220721 you LLIU-CGH8EY start 注释,依据本部和岗位子序列 给职种赋值 |
| | | /** |
| | | String zz = ''; |
| | | if(odsc.Job_Category__c == '服务'){ |
| | | zz = '销售服务'; |
| | |
| | | //如果自定义变迁的值为1,那么证明现在是在处理历史数据,而历史数据规定,如果ods的职种为空,那么就不需要更新user的职种 |
| | | if(String.isNotBlank(zz) || buffer != 1){ |
| | | userData.Job_Category__c = zz;//职种 |
| | | } |
| | | }**/ |
| | | String bbz=odsc.Category4__c+'-' +odsc.PositionSubsequence__c; //本部-岗位子序列 |
| | | String ldbb=odsc.Salesdepartment__c+'-' +odsc.PositionSubsequence__c; //六大本部-岗位子序列 |
| | | String bbz1=odsc.Category5__c+'-' +odsc.PositionSubsequence__c; //部-岗位子序列 |
| | | system.debug(bbz+'==='+ldbb+'==Job_CategoryMap=='+Job_CategoryMap); |
| | | //本部不等于空,看本部 |
| | | String zz = ''; |
| | | if( (String.isNotBlank(odsc.PositionSubsequence__c) && odsc.PositionSubsequence__c=='供应链管理') || ( String.isNotBlank(odsc.Category4__c) && odsc.Category4__c=='战略创新本部')){ |
| | | zz = '管理'; |
| | | }else if( String.isNotBlank(odsc.Category4__c) && odsc.Category4__c=='Solution本部'){ |
| | | zz = '市场'; |
| | | }else if(String.isNotBlank(odsc.Category4__c)){ |
| | | if(null!=Job_CategoryMap && Job_CategoryMap.containsKey(bbz)){ |
| | | if(Job_CategoryMap.get(bbz) == '服务'){ |
| | | zz = '销售服务'; |
| | | }else if(Job_CategoryMap.get(bbz) == '推广'){ |
| | | zz = '销售推广'; |
| | | }else{ |
| | | zz = Job_CategoryMap.get(bbz); |
| | | } |
| | | } |
| | | if(null!=Job_CategoryMap && Job_CategoryMap.containsKey(ldbb)){ |
| | | if(Job_CategoryMap.get(ldbb) == '服务'){ |
| | | zz = '销售服务'; |
| | | }else if(Job_CategoryMap.get(ldbb) == '推广'){ |
| | | zz = '销售推广'; |
| | | }else{ |
| | | zz = Job_CategoryMap.get(ldbb); |
| | | } |
| | | } |
| | | |
| | | system.debug('=='+Job_CategoryMap.get(bbz)+'==='+Job_CategoryMap.get(ldbb)+'==='+zz); |
| | | }else if(String.isBlank(odsc.Category4__c) && String.isNotBlank(odsc.Category5__c)){ |
| | | //本部等于空,看部 |
| | | if(odsc.Category5__c=='华北东北运营管理部' || odsc.Category5__c=='西北西南运营管理部' || odsc.Category5__c=='西北西南运营支援部' || bbz1=='华北东北服务部-综合行政' || bbz1=='华北东北市场部-综合行政'){ |
| | | zz = '支援'; |
| | | }else if(bbz1=='华北东北服务部-FSE'){ |
| | | zz = '销售服务'; |
| | | }else if(odsc.Category5__c=='西部战略推进部' || bbz1=='华北东北市场部-推广'){ |
| | | zz = '销售推广'; |
| | | } |
| | | } |
| | | userData.Job_Category__c = zz; |
| | | |
| | | // 20220721 you LLIU-CGH8EY end |
| | | |
| | | //userData.Product_specialist_incharge_product__c = odsc.Product_specialist_incharge_product__c;//负责产品(主) |
| | | //userData.Sales_Speciality__c = odsc.Sales_Speciality__c;//销售工作内容 |
| | | //HR信息上的工作地更新到用户的工作地(人事)上 thh 2022-02-16 start |
| | |
| | | User userData = new User(); |
| | | userData.Group_sales_dept__c = odsc.Category3__c;//统括本部 |
| | | if(String.isNotBlank(odsc.Category4__c)){ |
| | | userData.Dept__c = odsc.Category4__c;//本部 |
| | | //20220823 you LLIU-CHL8FB start |
| | | if(null!=DeptMap && DeptMap.containsKey(odsc.Category4__c)){ |
| | | userData.Dept__c = DeptMap.get(odsc.Category4__c);//本部 |
| | | }else{ |
| | | userData.Dept__c = odsc.Category4__c;//本部 |
| | | } |
| | | //20220823 you LLIU-CHL8FB end |
| | | } |
| | | userData.Category5__c = odsc.Category5__c;//部 |
| | | userData.Category6__c = odsc.Category6__c;//课 |
| | |
| | | userData.Username = '_'+odsc.Email__c;//用户名 |
| | | userData.Mobile_Phone__c = odsc.MobilePhone__c;//手机号码 |
| | | //如果自定义变迁的值为1,那么证明现在是在处理历史数据,而历史数据规定,如果ods的职位为空,那么就不需要更新user的职种 |
| | | //20220426 LLIU-CCY9TA you start |
| | | if(String.isNotBlank(odsc.Post__c) || buffer != 1){ |
| | | userData.Post__c = odsc.Post__c;//职位 |
| | | //userData.Post__c = odsc.Post__c;//职位 |
| | | userData.HR_Post__c = odsc.Post__c;//HR通用职级 |
| | | if(null!=UserAndContactMap && UserAndContactMap.containsKey(odsc.Post__c)){ |
| | | userData.Post__c = UserAndContactMap.get(odsc.Post__c); |
| | | } |
| | | } |
| | | //20220426 LLIU-CCY9TA you end |
| | | |
| | | //20220428 LLIU-CDW5ZW you start |
| | | userData.PositionSubsequence__c = odsc.PositionSubsequence__c; |
| | | //20220428 LLIU-CDW5ZW you end |
| | | //20220512 you LLIU-CDW5ZW start |
| | | userData.Rank__c = odsc.Rank__c; |
| | | //20220428 you LLIU-CDW5ZW end |
| | | // 20220721 you LLIU-CGH8EY start 注释,依据本部和岗位子序列 给职种赋值 |
| | | /** |
| | | String zz = ''; |
| | | if(odsc.Job_Category__c == '服务'){ |
| | | zz = '销售服务'; |
| | |
| | | //如果自定义变迁的值为1,那么证明现在是在处理历史数据,而历史数据规定,如果ods的职种为空,那么就不需要更新user的职种 |
| | | if(String.isNotBlank(zz) || buffer != 1){ |
| | | userData.Job_Category__c = zz;//职种 |
| | | } |
| | | }**/ |
| | | String bbz=odsc.Category4__c+'-' +odsc.PositionSubsequence__c; //本部-岗位子序列 |
| | | String ldbb=odsc.Salesdepartment__c+'-' +odsc.PositionSubsequence__c; //六大本部-岗位子序列 |
| | | String bbz1=odsc.Category5__c+'-' +odsc.PositionSubsequence__c; //部-岗位子序列 |
| | | //本部不等于空,看本部 |
| | | String zz = ''; |
| | | if( (String.isNotBlank(odsc.PositionSubsequence__c) && odsc.PositionSubsequence__c=='供应链管理') || ( String.isNotBlank(odsc.Category4__c) && odsc.Category4__c=='战略创新本部')){ |
| | | zz = '管理'; |
| | | }else if( String.isNotBlank(odsc.Category4__c) && odsc.Category4__c=='Solution本部'){ |
| | | zz = '市场'; |
| | | }else if(String.isNotBlank(odsc.Category4__c)){ |
| | | if(null!=Job_CategoryMap && Job_CategoryMap.containsKey(bbz)){ |
| | | if(Job_CategoryMap.get(bbz) == '服务'){ |
| | | zz = '销售服务'; |
| | | }else if(Job_CategoryMap.get(bbz) == '推广'){ |
| | | zz = '销售推广'; |
| | | }else{ |
| | | zz = Job_CategoryMap.get(bbz); |
| | | } |
| | | } |
| | | if(null!=Job_CategoryMap && Job_CategoryMap.containsKey(ldbb)){ |
| | | if(Job_CategoryMap.get(ldbb) == '服务'){ |
| | | zz = '销售服务'; |
| | | }else if(Job_CategoryMap.get(ldbb) == '推广'){ |
| | | zz = '销售推广'; |
| | | }else{ |
| | | zz = Job_CategoryMap.get(ldbb); |
| | | } |
| | | } |
| | | |
| | | }else if(String.isBlank(odsc.Category4__c) && String.isNotBlank(odsc.Category5__c)){ |
| | | //本部等于空,看部 LLIU-CKE3UG 增加映射关系 |
| | | if(odsc.Category5__c=='华北东北运营管理部' || odsc.Category5__c=='西北西南运营管理部' || odsc.Category5__c=='西北西南运营支援部' || bbz1=='华北东北服务部-综合行政' || bbz1=='华北东北市场部-综合行政'){ |
| | | zz = '支援'; |
| | | }else if(bbz1=='华北东北服务部-FSE'){ |
| | | zz = '销售服务'; |
| | | }else if(odsc.Category5__c=='西部战略推进部' || bbz1=='华北东北市场部-推广'){ |
| | | zz = '销售推广'; |
| | | } |
| | | } |
| | | userData.Job_Category__c = zz; |
| | | |
| | | // 20220721 you LLIU-CGH8EY end |
| | | userData.Null_Update__c = odsc.Null_Update__c; |
| | | userData.Product_specialist_incharge_product__c = odsc.Product_specialist_incharge_product__c;//负责产品(主) |
| | | userData.Sales_Speciality__c = odsc.Sales_Speciality__c;//销售工作内容 |
| | |
| | | |
| | | ,eventStatus__c, CancelReason__c, delayToDate__c, delayReason__c,DurationInMinutes__c,cancelReasonSelect__c,cancelReasonSelectFSE__c,cancelReasonOther__c,delayReasonOther__c,delayReasonSelect__c,delayReasonSelectFSE__c,BeforeActivityDate__c,OPDPlan_Flag__c,IsScheduled__c,AppCdId__c,SyncCreatedDate__c |
| | | // 20200420 任务日报管理 add gzw end |
| | | //,OPD_plan__c // 2022-4-14 yjk 增加OPD计划 |
| | | from Event__c where ActivityDate__c =:whereDate and Daily_Report__c = :oya.Id order by StartDateTime__c |
| | | ]; |
| | | } |
| | |
| | | Qty_Unit__c,Cost__c,UnitPrice__c,ListPrice__c,Quantity,TotalPrice__c, |
| | | PricebookEntry.Product2.SFDA_Status__c, ProductCode__c, Product_Cost__c,PricebookEntry.Product2.VenderName__c, Product2.VenderName__c,Product_ListPrice__c, PricebookEntry.Product2.Sales_Possibility__c, PricebookEntry.Product2.Name, |
| | | PricebookEntryId, PricebookEntry.Product2Id,UnitPrice_Page__c,PricebookEntry.Product2.Packing_list_manual__c,PricebookEntry.Product2.StorageStatus__c |
| | | // 2022-03-21 SWAG-CBX5NN start |
| | | ,If_Cancel_Guarantee__c |
| | | ,multiYearWarranty__c |
| | | ,CanNotCancelFlag__c |
| | | ,ProductEntend_gurantee_period_all__c |
| | | ,warrantyType__c |
| | | ,GuaranteePeriod__c |
| | | ,GuranteeType__c |
| | | // 2022-03-21 SWAG-CBX5NN end |
| | | From QuoteLineItem where Quoteid = :QuoteidOldList]; |
| | | for(QuoteLineItem qli : oldQuoteitemList){ |
| | | QuidWithQLitem.put(qli.Quoteid,qli); |
| | |
| | | public static void lostOrder(Lost_Report__c lostData) { |
| | | upsert lostData; |
| | | } |
| | | |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)start |
| | | public static String getKeyByProduct(String keyword) { |
| | | if (String.isBlank(keyword)) { |
| | | return null; |
| | | } |
| | | String KeyProductMapping = System.Label.Key_Product_Mapping; |
| | | Map<String, Object> mapping = (Map<String, Object>) JSON.deserializeUntyped(KeyProductMapping); |
| | | System.debug('==Mapping is: ' + mapping); |
| | | |
| | | return mapping.get(keyword) != null ? String.valueOf(mapping.get(keyword)) : null; |
| | | } |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)end |
| | | |
| | | //20221021 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | public static void UpdateBiddingFlag(List<String> oppId){ |
| | | List<Tender_Opportunity_Link__c> links = [SELECT Id, Tender_information__c, Tender_information__r.IsReactionOpp__c, Opportunity__c |
| | | FROM Tender_Opportunity_Link__c |
| | | WHERE Opportunity__c in :oppId ]; |
| | | |
| | | Map<String,Tender_information__c> tenderMap = new Map<String,Tender_information__c>(); |
| | | |
| | | for (Tender_Opportunity_Link__c link : links){ |
| | | |
| | | Tender_information__c temptender = new Tender_information__c(); |
| | | temptender.Id = link.Tender_information__c; |
| | | temptender.IsReactionOpp__c = true; |
| | | tenderMap.put(temptender.id ,temptender); |
| | | |
| | | } |
| | | |
| | | if(tenderMap.size()>0){ |
| | | update tenderMap.values(); |
| | | } |
| | | |
| | | } |
| | | //20221021 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | } |
| | |
| | | // Account internalAcc = [Select Id from Account where Id = :System.Label.Olympus_AccountID_Internal_staff]; |
| | | // // データがあればOK; |
| | | //} |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'}); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test1(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | AWSServiceTool2.EncryptPushFuture(null,null); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test2(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | Aws_Data_Id__c = '123456' |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test3(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | |
| | | Test.startTest(); |
| | | AWSServiceTool2.EncryptPushData(new string[]{'0031000000O4Cff'}); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | class HttpMock implements HttpCalloutMock{ |
| | | |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | if(request.getEndpoint().contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | // } |
| | | } |
| | | } |
| | | private static User getUser() { |
| | | String timenow = Datetime.now().format('yyyyMMddHHmmss'); |
| | | User user1 = new User(Test_staff__c = true, LastName = 'TestMao', FirstName = 'TestMaoF', |
| | |
| | | accDep.CurrencyIsoCode = 'CNY'; |
| | | accDep.RecordTypeId = rtDep.id; |
| | | insert accDep; |
| | | List<Contact> conList = new List<Contact>(); |
| | | Contact con1 = new Contact(); |
| | | con1.Firstname='ZZ1'; |
| | | con1.LastName = '取引先責任者1'; |
| | | con1.RecordTypeId = rtDoc.id; |
| | | con1.AccountId = accDep.Id; |
| | | conList.add(con1); |
| | | //List<Contact> conList = new List<Contact>(); |
| | | //Contact con1 = new Contact(); |
| | | //con1.Firstname='ZZ1'; |
| | | //con1.LastName = '取引先責任者1'; |
| | | //con1.RecordTypeId = rtDoc.id; |
| | | //con1.AccountId = accDep.Id; |
| | | //conList.add(con1); |
| | | |
| | | insert conList; |
| | | //insert conList; |
| | | RecordType Type = [select id from RecordType where DeveloperName='SI_Oppor']; |
| | | String TypeID = Type.Id; |
| | | Opportunity opp1 = new Opportunity(); |
| | |
| | | accDep.CurrencyIsoCode = 'CNY'; |
| | | accDep.RecordTypeId = rtDep.id; |
| | | insert accDep; |
| | | List<Contact> conList = new List<Contact>(); |
| | | Contact con1 = new Contact(); |
| | | con1.Firstname='ZZ1'; |
| | | con1.LastName = '取引先責任者1'; |
| | | con1.RecordTypeId = rtDoc.id; |
| | | con1.AccountId = accDep.Id; |
| | | conList.add(con1); |
| | | //List<Contact> conList = new List<Contact>(); |
| | | //Contact con1 = new Contact(); |
| | | //con1.Firstname='ZZ1'; |
| | | //con1.LastName = '取引先責任者1'; |
| | | //con1.RecordTypeId = rtDoc.id; |
| | | //con1.AccountId = accDep.Id; |
| | | //conList.add(con1); |
| | | |
| | | insert conList; |
| | | //insert conList; |
| | | RecordType Type = [select id from RecordType where DeveloperName='SI_Oppor']; |
| | | String TypeID = Type.Id; |
| | | Opportunity opp1 = new Opportunity(); |
| New file |
| | |
| | | /************************************************************************************************** |
| | | @Author: 黄千龙 |
| | | @Name: CoverageTargetHPBatch |
| | | @CreateDate: 13/04/2022 |
| | | @Description: 覆盖率目标医院 |
| | | @Version 1.0 |
| | | *****************************************************************************************************/ |
| | | global class CoverageTargetHPBatch implements Database.Batchable<sObject>,Database.Stateful { |
| | | public String query; |
| | | private BatchIF_Log__c iflog; |
| | | public List < String > accountIdList; |
| | | global CoverageTargetHPBatch() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global CoverageTargetHPBatch(List < String > accountIdList) { |
| | | this.query = query; |
| | | this.accountIdList = accountIdList; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | system.debug('执行start'); |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'PushNotification'; |
| | | iflog.Log__c = 'CoverageTargetHPBatch start\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | | String query = 'SELECT Id,Name,IF_Coverage_Target_HP__c FROM Account WHERE Is_Active__c =\'有効\' AND RecordType.DeveloperName =\'HP\' AND ( NOT Name LIKE \'%olympus%\') AND ( NOT Name LIKE \'%TEST%\')'; |
| | | if (accountIdList != null && accountIdList.size() > 0) { |
| | | query += ' AND Id IN :accountIdList'; |
| | | } |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Account> accList) { |
| | | List<String> accIds = new List<String>(); |
| | | for(Account acc:accList){ |
| | | accIds.add(acc.Id); |
| | | } |
| | | List<Account> updateAccList = new List<Account>(); |
| | | for(AggregateResult result:[SELECT count(Id),Hospital__c FROM Asset WHERE Product2.ServiceCategory__c ='软性镜' AND Hospital__c IN: accIds AND (Status = '使用中' or Status = '未使用' or Status = '不明') Group by Hospital__c having count(Id)>=5]){ |
| | | Account acc = new Account(); |
| | | acc.Id = String.valueOf(result.get('Hospital__c')); |
| | | acc.IF_Coverage_Target_HP__c= '1'; |
| | | updateAccList.add(acc); |
| | | } |
| | | Oly_TriggerHandler.bypass('NFM701ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | update updateAccList; |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | iflog.Log__c += '\nCoverageTargetHPBatch end'; |
| | | String tmp = iflog.ErrorLog__c; |
| | | if (tmp.length() > 65000) { |
| | | tmp = tmp.substring(0, 65000); |
| | | tmp += ' ...have more lines...'; |
| | | iflog.ErrorLog__c = tmp; |
| | | } |
| | | update iflog; |
| | | if (accountIdList != null && accountIdList.size() > 0) { |
| | | database.executeBatch(new EquipmentCoverageTargetBatch(accountIdList),200); |
| | | }else{ |
| | | database.executeBatch(new EquipmentCoverageTargetBatch(),200); |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class CoverageTargetHPBatchTest { |
| | | static testMethod void testMethod1() { |
| | | database.executeBatch(new CoverageTargetHPBatch(),200); |
| | | } |
| | | @testSetup |
| | | private static void setUpDate(){ |
| | | // 病院を作る |
| | | Date toDayTime = Date.today(); |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'hospitalabc'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.Attribute_Type__c = '卫生部'; |
| | | hospital.Speciality_Type__c = '综合医院'; |
| | | hospital.Grade__c = '一级'; |
| | | hospital.IF_Coverage_Target_HP__c = '1'; |
| | | hospital.OCM_Category__c = 'SLTV'; |
| | | hospital.Is_Medical__c = '医疗机构'; |
| | | hospital.Town__c = '东京'; |
| | | Oly_TriggerHandler.bypass('NFM701ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | insert hospital; |
| | | |
| | | // 戦略科室を得る |
| | | Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH']; |
| | | // 診療科を作る |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id; |
| | | dep.Name = 'test dep'; |
| | | dep.AgentCode_Ext__c = System.Label.Account_Asset_FJZ; |
| | | dep.ParentId = strategicDep[0].Id; |
| | | dep.Department_Class__c = strategicDep[0].Id; |
| | | dep.Hospital__c = hospital.Id; |
| | | Oly_TriggerHandler.bypass('NFM701ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | insert dep; |
| | | |
| | | |
| | | |
| | | // 产品 |
| | | Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n01', |
| | | Maintenance_Price_Year__c = 999, |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | ProductCode_Ext__c='pc01',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | Category3__c='电子镜'); |
| | | Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing', |
| | | ProductCode_Ext__c='pc02',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | Maintenance_Price_Year__c = 999, |
| | | Category3__c='纤维镜'); |
| | | Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing', |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | ProductCode_Ext__c='pc03',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | Maintenance_Price_Year__c = 999, |
| | | Category3__c='电子镜'); |
| | | Product2 pro4 = new Product2(Name='name04',IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n04',Serial_Lot_No__c='Lot tracing', |
| | | ProductCode_Ext__c='pc04',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | Maintenance_Price_Year__c = 999, |
| | | Category3__c='电子镜'); |
| | | Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n05',Serial_Lot_No__c='Lot tracing',Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | Maintenance_Price_Year__c = 999, |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false, |
| | | Category3__c='电子镜'); |
| | | insert new Product2[] {pro1, pro2, pro3,pro4,pro5}; |
| | | |
| | | |
| | | |
| | | Maintenance_Contract__c contract = new Maintenance_Contract__c(); |
| | | contract.Name = 'tect contract'; |
| | | contract.status__c ='契約'; |
| | | contract.Maintenance_Contract_No__c = 'Kami_Contract_No'; |
| | | contract.Contract_Conclusion_Date__c = Date.today(); |
| | | contract.Hospital__c = hospital.Id; |
| | | contract.Department_Class__c = strategicDep[0].Id; |
| | | contract.Department__c = dep.Id; |
| | | contract.Contract_Start_Date__c=Date.newInstance(toDayTime.year(),3,2); // 10日前 |
| | | contract.Contract_End_Date__c = Date.newInstance(toDayTime.year()+1,3,20); // 5日後 |
| | | contract.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('VM_Contract').getRecordTypeId(); |
| | | insert contract; |
| | | |
| | | List<Maintenance_Contract__c> MaintenanceContract=[select id from Maintenance_Contract__c]; |
| | | |
| | | //---------------------------主体 两个附属品(个体管理 数量管理) |
| | | // 保有设备A (主体) |
| | | Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA1.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA1.SerialNumber = 'ass01'; |
| | | assetA1.Name = 'ass01'; |
| | | assetA1.AccountId = dep.Id; |
| | | assetA1.Department_Class__c = strategicDep[0].Id; |
| | | assetA1.Hospital__c = hospital.Id; |
| | | assetA1.Product2Id = pro1.Id; |
| | | assetA1.Quantity = 1; |
| | | |
| | | assetA1.Status = '使用中'; |
| | | assetA1.Manage_type__c = '个体管理'; |
| | | assetA1.Loaner_accsessary__c = false; |
| | | assetA1.Product_category__c = 'GI'; |
| | | assetA1.Delete_Flag__c = false; |
| | | assetA1.Freeze_sign__c = false; |
| | | assetA1.Out_of_wh__c = 0; |
| | | assetA1.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA1.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA1.Product_category__c = 'GI'; |
| | | assetA1.Equipment_Type__c = '产品试用'; |
| | | assetA1.SalesProvince__c = '北京'; |
| | | assetA1.WH_location__c = '货架号1'; |
| | | assetA1.Asset_loaner_category__c = '固定资产'; |
| | | assetA1.CompanyOfEquipment__c = '123'; |
| | | assetA1.Internal_Asset_number__c = '123'; |
| | | assetA1.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA1.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA2 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA2.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA2.SerialNumber = 'ass02'; |
| | | assetA2.Name = 'ass02'; |
| | | assetA2.AccountId = dep.Id; |
| | | assetA2.Department_Class__c = strategicDep[0].Id; |
| | | assetA2.Hospital__c = hospital.Id; |
| | | assetA2.Product2Id = pro2.Id; |
| | | assetA2.Quantity = 10; |
| | | assetA2.Status = '使用中'; |
| | | assetA2.Manage_type__c = '数量管理'; |
| | | assetA2.Loaner_accsessary__c = true; |
| | | assetA2.Product_category__c = 'GI'; |
| | | assetA2.Delete_Flag__c = false; |
| | | assetA2.Freeze_sign__c = false; |
| | | assetA2.Out_of_wh__c = 3; |
| | | |
| | | assetA2.Frozen_Quantity__c = 2; |
| | | assetA2.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA2.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA2.Product_category__c = 'GI'; |
| | | assetA2.Equipment_Type__c = '产品试用'; |
| | | assetA2.SalesProvince__c = '北京'; |
| | | assetA2.WH_location__c = '货架号2'; |
| | | assetA2.Asset_loaner_category__c = '固定资产'; |
| | | assetA2.CompanyOfEquipment__c = '123'; |
| | | assetA2.Internal_Asset_number__c = '123'; |
| | | assetA2.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 个体管理) |
| | | Asset assetA3 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA3.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA3.SerialNumber = 'ass03'; |
| | | assetA3.Name = 'ass03'; |
| | | assetA3.AccountId = dep.Id; |
| | | assetA3.Department_Class__c = strategicDep[0].Id; |
| | | assetA3.Hospital__c = hospital.Id; |
| | | assetA3.Product2Id = pro3.Id; |
| | | assetA3.Quantity = 10; |
| | | assetA3.Status = '使用中'; |
| | | assetA3.Manage_type__c = '数量管理'; |
| | | assetA3.Loaner_accsessary__c = true; |
| | | assetA3.Product_category__c = 'GI'; |
| | | assetA3.Delete_Flag__c = false; |
| | | |
| | | assetA3.Freeze_sign__c = false; |
| | | assetA3.Out_of_wh__c = 3; |
| | | assetA3.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA3.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA3.Product_category__c = 'GI'; |
| | | assetA3.Equipment_Type__c = '产品试用'; |
| | | assetA3.SalesProvince__c = '北京'; |
| | | assetA3.WH_location__c = '货架号3'; |
| | | assetA3.Abandoned_Inventory__c = 1; |
| | | assetA3.Asset_loaner_category__c = '固定资产'; |
| | | assetA3.CompanyOfEquipment__c = '123'; |
| | | assetA3.Internal_Asset_number__c = '123'; |
| | | assetA3.CurrentContract__c=MaintenanceContract[0].Id; |
| | | |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA4 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA4.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA4.SerialNumber = 'ass04'; |
| | | assetA4.Name = 'ass04'; |
| | | assetA4.AccountId = dep.Id; |
| | | assetA4.Department_Class__c = strategicDep[0].Id; |
| | | assetA4.Hospital__c = hospital.Id; |
| | | assetA4.Product2Id = pro4.Id; |
| | | assetA4.Quantity = 10; |
| | | assetA4.Status = '使用中'; |
| | | |
| | | assetA4.Manage_type__c = '数量管理'; |
| | | assetA4.Loaner_accsessary__c = true; |
| | | assetA4.Product_category__c = 'GI'; |
| | | assetA4.Delete_Flag__c = false; |
| | | assetA4.Freeze_sign__c = false; |
| | | assetA4.Out_of_wh__c = 3; |
| | | assetA4.Frozen_Quantity__c = 2; |
| | | assetA4.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA4.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA4.Product_category__c = 'GI'; |
| | | assetA4.Equipment_Type__c = '产品试用'; |
| | | assetA4.SalesProvince__c = '北京'; |
| | | assetA4.WH_location__c = '货架号2'; |
| | | assetA4.Asset_loaner_category__c = '固定资产'; |
| | | assetA4.CompanyOfEquipment__c = '123'; |
| | | assetA4.Internal_Asset_number__c = '123'; |
| | | assetA4.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA5 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA5.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA5.SerialNumber = 'ass05'; |
| | | assetA5.Name = 'ass05'; |
| | | assetA5.AccountId = dep.Id; |
| | | assetA5.Department_Class__c = strategicDep[0].Id; |
| | | assetA5.Hospital__c = hospital.Id; |
| | | assetA5.Product2Id = pro5.Id; |
| | | assetA5.Quantity = 10; |
| | | assetA5.Status = '使用中'; |
| | | assetA5.Manage_type__c = '数量管理'; |
| | | assetA5.Loaner_accsessary__c = true; |
| | | assetA5.Product_category__c = 'GI'; |
| | | assetA5.Delete_Flag__c = false; |
| | | |
| | | assetA5.Freeze_sign__c = false; |
| | | assetA5.Out_of_wh__c = 3; |
| | | assetA5.Frozen_Quantity__c = 2; |
| | | assetA5.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA5.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA5.Product_category__c = 'GI'; |
| | | assetA5.Equipment_Type__c = '产品试用'; |
| | | assetA5.SalesProvince__c = '北京'; |
| | | assetA5.WH_location__c = '货架号2'; |
| | | assetA5.Asset_loaner_category__c = '固定资产'; |
| | | assetA5.CompanyOfEquipment__c = '123'; |
| | | assetA5.Internal_Asset_number__c = '123'; |
| | | assetA5.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | Oly_TriggerHandler.bypass('AssetHandlerCheck'); |
| | | insert new Asset[] {assetA1, assetA2, assetA3,assetA4,assetA5}; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | String query = 'SELECT Id,Status__c,Contract_Start_Date__c,Contract_print_completed__c,Contract_End_Date__c,Contract_Conclusion_Date__c,RecordType.DeveloperName ' |
| | | +'FROM Maintenance_Contract__c ' |
| | | +'WHERE RecordType.DeveloperName = \'NewMaintenance_Contract\' AND Contract_Start_Date__c != NULL AND Contract_End_Date__c != NULL ' |
| | | //URF限次合同2期 LY 20220811 start |
| | | +'AND URF_Contract__c = false ' |
| | | //URF限次合同2期 LY 20220811 end |
| | | +'AND Status__c = \'契約\' AND Contract_Conclusion_Date__c != NULL '; |
| | | if (String.isNotBlank(this.tempMainId)) { |
| | | query += 'AND Id = :tempMainId'; |
| | |
| | | oppSql += ' where id in :TEST_ID'; |
| | | }else{ |
| | | oppSql += ' where StageName = \'引合\' and ForecastAccuracyObject__c = true'; |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | // oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | |
| | | oppSql += ' and IsNextMonthOfVisit__c = false and SalesdepartmentForecast__c in :areas'; |
| | | // 5)客户为H层客户的询价 |
| | | // oppSql += ' and (OCM__c = \'H0\' or OCM__c = \'H1\')'; |
| | |
| | | oppSql += ' where id in :TEST_ID'; |
| | | }else{ |
| | | oppSql += ' where StageName = \'引合\' and ForecastAccuracyObject__c = true'; |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | // oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | oppSql += ' and IsNextMonthOfVisit__c = false and SalesdepartmentForecast__c in :areas'; |
| | | // 5)客户为H层客户的询价 |
| | | // oppSql += ' and (OCM__c = \'H0\' or OCM__c = \'H1\')'; |
| New file |
| | |
| | | public with sharing class DealerPersonnelController { |
| | | public DealerPersonnelController() { |
| | | |
| | | } |
| | | @AuraEnabled |
| | | public static String processData(String fileData,String sobjectName,List<String> fields) { |
| | | system.debug('fileData===============>'+fileData); |
| | | String errorMage = ''; |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | if(fileData != null){ |
| | | String[] fileLines = new String[]{}; |
| | | fileLines = fileData.split('\n'); |
| | | system.debug('fileLines===================>'+fileLines); |
| | | // 经销商管理编码 |
| | | List<String> managementCodeList = new List<String>(); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | // 客户名 |
| | | List<String> CustomerNameList = new List<String>(); |
| | | //人员管理编码 |
| | | List<String> CManageCodeList = new List<String>(); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | // 导入的数据 |
| | | List<List<String>> inputList = new List<List<String>>(); |
| | | for (Integer i = 1,j = fileLines.size(); i < j; i++) { |
| | | List<String> inputValues = new List<String>(); |
| | | if(fileLines[i].replace(',','').trim()!=''){ |
| | | inputValues = fileLines[i].split(',',-1); |
| | | System.debug('inputValues=============>'+inputValues); |
| | | System.debug('fileLines[i]=============>'+fileLines[i]); |
| | | if(inputValues != null){ |
| | | if(inputValues[0] == '' || inputValues[0]== null){ |
| | | errorMage += 'errorMage: 第' + i + '行,姓名不能为空!'; |
| | | errorMage += '='; |
| | | } |
| | | // if(inputValues[1] == '' || inputValues[1] ==null){ |
| | | // errorMage += 'errorMage: 第' + i + '行,手机不能为空!'; |
| | | // errorMage += '='; |
| | | // } |
| | | // boolean mobileNumberFlag = mobileNumberVerification(inputValues[1]); |
| | | // if(mobileNumberFlag == false){ |
| | | // errorMage += 'errorMage: 你的手机号码不太正确,请检查您的手机是否正确!'; |
| | | // errorMage += '='; |
| | | // } |
| | | // if(inputValues[2] == '' || inputValues[2] == null){ |
| | | // errorMage += 'errorMage: 第' + i + '行,邮箱不能为空!'; |
| | | // errorMage += '='; |
| | | // } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | if(inputValues[2] != '' && inputValues[2] != null){ |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | boolean mailboxFlag = mailboxVerification(inputValues[2]); |
| | | if(mailboxFlag == false){ |
| | | errorMage += 'errorMage: 你的邮箱不太正确,请检查您的邮箱格式!'; |
| | | errorMage += '='; |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | if(inputValues[3] == '' || inputValues[3] == null){ |
| | | errorMage += 'errorMage: 第' + i + '行,经销商管理编码不能为空!'; |
| | | errorMage += '='; |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | if(inputValues[4] == '' || inputValues[4] == null){ |
| | | errorMage += 'errorMage: 第' + i + '行,客户名不能为空!'; |
| | | errorMage += '='; |
| | | } |
| | | if(inputValues[5] == '' || inputValues[5] == null){ |
| | | errorMage += 'errorMage: 第' + i + '行,经销商用户不能为空!'; |
| | | errorMage += '='; |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | managementCodeList.add(inputValues[3]); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | CustomerNameList.add(inputValues[4]); |
| | | CManageCodeList.add(inputValues[6]); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | inputList.add(inputValues); |
| | | //导入的数据 |
| | | System.debug('inputValues[0]===============>'+ inputValues[0]); |
| | | System.debug('inputValues[1]===============>'+ inputValues[1]); |
| | | System.debug('inputValues[2]===============>'+ inputValues[2]); |
| | | System.debug('inputValues[3]===============>'+ inputValues[3]); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | System.debug('inputValues[4]===============>'+ inputValues[4]); |
| | | System.debug('inputValues[4]===============>'+ inputValues[5]); |
| | | System.debug('inputValues[6]===============>'+ inputValues[6]); |
| | | System.debug('inputValues[7]===============>'+ inputValues[7]); |
| | | System.debug('inputValues[8]===============>'+ inputValues[8]); |
| | | System.debug('inputValues[9]===============>'+ inputValues[9]); |
| | | System.debug('inputValues[10]===============>'+ inputValues[10]); |
| | | System.debug('inputValues[11]===============>'+ inputValues[11]); |
| | | System.debug('inputValues[12]===============>'+ inputValues[12]); |
| | | System.debug('inputValues[13]===============>'+ inputValues[13]); |
| | | System.debug('inputValues[14]===============>'+ inputValues[14]); |
| | | System.debug('inputValues[15]===============>'+ inputValues[15]); |
| | | System.debug('inputValues[16]===============>'+ inputValues[16]); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | |
| | | } |
| | | } |
| | | } |
| | | Map<String,Account> accountIdMap = new Map<String,Account>(); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | Map<String,Contact> contactIdMap = new Map<String,Contact>(); |
| | | Map<Id,String> ManagementCodeMap = new Map<Id,String>(); |
| | | List<Id> AccountIdList =new List<Id>(); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | List<Account> accountList = [select id, Name,Management_Code__c from Account where Management_Code__c in: managementCodeList and Name in:CustomerNameList ]; |
| | | for(Account ac : accountList){ |
| | | accountIdMap.put(ac.Management_Code__c,ac); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | AccountIdList.add(ac.Id); |
| | | ManagementCodeMap.put(ac.Id,ac.Management_Code__c); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | //查询客户人员是否有数据 |
| | | List<Contact> contactList = [select id, CManageCode__c,AccountId from Contact where AccountId in: AccountIdList and CManageCode__c in:CManageCodeList ]; |
| | | for(Contact cc : contactList){ |
| | | String contactKey=ManagementCodeMap.get(cc.AccountId)+'_'+cc.CManageCode__c; |
| | | contactIdMap.put(contactKey,cc); |
| | | } |
| | | List<Contact> cnupdateList = new List<Contact>(); |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | List<Contact> cnList = new List<Contact>(); |
| | | Integer lineNumber = 1; |
| | | for(List<String> lineList :inputList){ |
| | | Contact con = new Contact(); |
| | | //暂时导入的是经销商用户,所以记录类型只有经销商,暂时写死;后期如果有变动再更改 |
| | | con.RecordTypeId = '01210000000QfWiAAK'; |
| | | if(!contactIdMap.containsKey(lineList[3]+'_'+lineList[6])){ |
| | | if(lineList[0] != null && lineList[0] != ''){ |
| | | con.LastName = lineList[0]; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,姓氏'+lineList[0]+'不存在'; |
| | | errorMage += '='; |
| | | } |
| | | } |
| | | if(lineList[1] != null && lineList[1] != ''){ |
| | | // if(mobileNumberVerification(lineList[1])){ |
| | | con.MobilePhone = lineList[1]; |
| | | // }else{ |
| | | // errorMage += 'error: 第'+ lineNumber +'行数据,手机'+lineList[1]+'不正确!'; |
| | | // errorMage += '='; |
| | | // } |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | // else{ |
| | | // errorMage += 'error: 第'+ lineNumber +'行数据,手机'+lineList[1]+'不存在'; |
| | | // errorMage += '='; |
| | | // } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | if(lineList[2] != null && lineList[2] != ''){ |
| | | if(mailboxVerification(lineList[2])){ |
| | | con.Email = lineList[2]; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,电子邮件'+lineList[2]+'不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | // else{ |
| | | // errorMage += 'error: 第'+ lineNumber +'行数据,电子邮件'+lineList[2]+'不存在'; |
| | | // errorMage += '='; |
| | | // } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | if(accountIdMap.containsKey(lineList[3])){ |
| | | con.AccountId = accountIdMap.get(lineList[3]).id; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,经销商编码'+lineList[3]+'不存在'; |
| | | errorMage += '='; |
| | | } |
| | | //暂定创建直接为 true |
| | | // con.Agency_User__c = true; |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | if(lineList[5] != null && lineList[5] != ''){ |
| | | if(lineList[5]=='true'||lineList[5]=='TRUE'){ |
| | | con.Agency_User__c=true; |
| | | }else{ |
| | | con.Agency_User__c=false; |
| | | } |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,经销商用户'+lineList[0]+'不存在'; |
| | | errorMage += '='; |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | //经销商专员类型 |
| | | if(VerificationOLYAssistantType(lineList[7])){ |
| | | con.OLY_Assistant_Type__c = lineList[7]; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,经销商专员类型'+lineList[7]+'不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //入职年份 |
| | | if(VerificationDateType(lineList[8])){ |
| | | con.InductionYear__c = ConversionDateType(lineList[8]); |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,入职年份'+lineList[8]+'格式不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //GIR认证级别 |
| | | if(VerifyCertificationLevel(lineList[9])){ |
| | | con.GIR_CertificationLevel__c = lineList[9]; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,GIR认证级别'+lineList[9]+'不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //GIR认证时间 |
| | | if(VerificationDateType(lineList[10])){ |
| | | con.GIR_CertificationTime__c = ConversionDateType(lineList[10]); |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,GIR认证时间'+lineList[10]+'格式不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //SP认证级别 |
| | | if(VerifyCertificationLevel(lineList[11])){ |
| | | con.SP_CertificationLevel__c = lineList[11]; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,SP认证级别'+lineList[11]+'不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //SP认证时间 |
| | | if(VerificationDateType(lineList[12])){ |
| | | con.SP_CertificationTime__c = ConversionDateType(lineList[12]); |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,SP认证时间'+lineList[12]+'格式不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //ET认证级别 |
| | | if(VerifyCertificationLevel(lineList[13])){ |
| | | con.ET_CertificationLevel__c = lineList[13]; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,ET认证级别'+lineList[13]+'不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //ET认证时间 |
| | | if(VerificationDateType(lineList[14])){ |
| | | con.ET_CertificationTime__c = ConversionDateType(lineList[14]); |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,ET认证时间'+lineList[14]+'格式不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //ENG认证级别 |
| | | if(VerifyCertificationLevel(lineList[15])){ |
| | | con.ENG_CertificationLevel__c = lineList[15]; |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,ENG认证级别'+lineList[15]+'不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //ENG认证时间 |
| | | if(VerificationDateType(lineList[16])){ |
| | | con.ENG_CertificationTime__c = ConversionDateType(lineList[16]); |
| | | }else{ |
| | | errorMage += 'error: 第'+ lineNumber +'行数据,ENG认证时间'+lineList[16]+'格式不正确!'; |
| | | errorMage += '='; |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | lineNumber++; |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | System.debug('001+'+lineList[3]+'_'+lineList[6]); |
| | | System.debug('002+'+contactIdMap.get(lineList[3]+'_'+lineList[6])); |
| | | if(contactIdMap.containsKey(lineList[3]+'_'+lineList[6])){ |
| | | con.Id=contactIdMap.get(lineList[3]+'_'+lineList[6]).Id; |
| | | cnupdateList.add(con); |
| | | }else { |
| | | cnList.add(con); |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | // cnList.add(con); |
| | | } |
| | | if(errorMage != ''){ |
| | | system.debug('errorMage==========>'+errorMage); |
| | | return errorMage; |
| | | } |
| | | |
| | | |
| | | // 新增周报明细 |
| | | if(cnList.size() > 0 ){ |
| | | System.debug('003+'+cnList); |
| | | insertContact(cnList); |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | // 更新周报明细 |
| | | if(cnupdateList.size() > 0 ){ |
| | | System.debug('004+'+cnupdateList); |
| | | updateContact(cnupdateList); |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | } |
| | | return 'success'; |
| | | } catch (Exception e) { |
| | | Database.rollback(sp); |
| | | System.debug('exception++++++++++++++++++'+e.getLineNumber()+e); |
| | | return e.getLineNumber()+'exception'+e; |
| | | } |
| | | } |
| | | // 电子邮件的验证 |
| | | public static boolean mailboxVerification(String mailbox){ |
| | | String check = '^([a-z0-9A-Z]+[_-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$'; |
| | | Pattern regex = Pattern.compile(check); |
| | | Matcher matcher = regex.matcher(mailbox); |
| | | if (matcher.matches()){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | // 手机号的验证 |
| | | // public static boolean mobileNumberVerification(String phoneNumber){ |
| | | // String check = '^((17[0-9])|(14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$'; |
| | | // Pattern regex = Pattern.compile(check); |
| | | // Matcher matcher = regex.matcher(phoneNumber); |
| | | // if(matcher.matches()){ |
| | | // return true; |
| | | // } |
| | | // return false; |
| | | // } |
| | | //新增客户人员; |
| | | public static void insertContact(List<Contact> data) { |
| | | insert data; |
| | | } |
| | | // SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy start |
| | | //校验认证级别; |
| | | public static boolean VerifyCertificationLevel(String data) { |
| | | if(data=='A'||data=='B'||data==''){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | //校验日期类型 |
| | | public static Boolean VerificationDateType(String data) { |
| | | List<String> date1str; |
| | | List<String> date2str; |
| | | if(data==''){ |
| | | return true; |
| | | } |
| | | date1str=data.split('/'); |
| | | date2str=data.split('-'); |
| | | if(date1str.size()>1||date2str.size()>1){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | //转换日期类型; |
| | | public static Date ConversionDateType(String data) { |
| | | if(data==''){ |
| | | return null; |
| | | } |
| | | return Date.valueOf(data.replace('/','-')); |
| | | } |
| | | //校验经销商专员类型; |
| | | public static Boolean VerificationOLYAssistantType(String data) { |
| | | if(data=='GR专员'||data=='SP专员'||data=='GRSP专员'||data=='ET专员'||data=='TB专员'||data=='奥辉基层专员'||data=='商务助理'||data=='*****'||data==''){ |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | //更新客户人员; |
| | | public static void updateContact(List<Contact> data){ |
| | | update data; |
| | | } |
| | | //SWAG-CEW85A 【委托】消耗品&DAMS系统经销商人员管理——信息完善;fy end |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>52.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public with sharing class DealerPersonnelControllerTest { |
| | | public static Account account1 = new Account(); |
| | | private static void testInit() { |
| | | account1.Name = 'test1医院'; |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | | account1.AgentCode_Ext__c = '737011'; |
| | | insert account1; |
| | | } |
| | | @isTest public static void selectProductCcategoryTest() { |
| | | testInit(); |
| | | Test.startTest(); |
| | | String reports = DealerPersonnelController.processData('"姓名,手机,电子邮件,经销商编码,客户名,经销商用户,人员管理编码,经销商专员类型,入职年份,GIR认证级别,GIR认证时间,SP认证级别,SP认证时间,ET认证级别,ET认证时间,ENG认证级别,ENG认证时间\r\n小王,18801332211,123@qq.com,737011,启稳起步,TRUE,C000125941,SP专员,2021/1/7,A,2022/1/7,A,2019/1/7,A,2021/2/7,B,2020/1/7\r\n','',null); |
| | | Test.stopTest(); |
| | | } |
| | | @isTest public static void selectProductCcategoryTest01() { |
| | | testInit(); |
| | | Test.startTest(); |
| | | String reports = DealerPersonnelController.processData('"姓名,手机,电子邮件,经销商编码,客户名,经销商用户,人员管理编码,经销商专员类型,入职年份,GIR认证级别,GIR认证时间,SP认证级别,SP认证时间,ET认证级别,ET认证时间,ENG认证级别,ENG认证时间\r\n,,123,,,,,123,123,123,123,123,13,12,123,132,13\r\n','',null); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| force-app/main/default/classes/DealerPersonnelControllerTest.cls-meta.xml
force-app/main/default/classes/DirectAssignController.cls
force-app/main/default/classes/ET_Agency_Target_Result_Table_Batch.cls
force-app/main/default/classes/ET_Agency_Target_Result_Table_Batch2.cls
force-app/main/default/classes/ET_Agency_Target_Result_Table_Batch2Test.cls
force-app/main/default/classes/ET_Agency_Target_Result_Table_BatchTest.cls
force-app/main/default/classes/ET_Product_CategoryPrice_Table_Batch.cls
force-app/main/default/classes/ET_Product_CategoryPrice_Table_BatchTest.cls
force-app/main/default/classes/ET_Product_ScoreTableHistory_Batch2.cls
force-app/main/default/classes/ET_Product_ScoreTableHistory_Batch2Test.cls
force-app/main/default/classes/ET_Product_ScoreTableHistory_Batch3.cls
force-app/main/default/classes/ET_Product_ScoreTableHistory_Batch3Test.cls
force-app/main/default/classes/ET_Product_ScoreTable_Batch.cls
force-app/main/default/classes/ET_Product_ScoreTable_BatchTest.cls
force-app/main/default/classes/EnquiryBoostTypeBatch.cls
force-app/main/default/classes/EnquiryDetailsController.cls
force-app/main/default/classes/EnquiryDetailsControllerTest.cls
force-app/main/default/classes/EnquiryDetailsWebService.cls
force-app/main/default/classes/EnquiryDetailsWebService.cls-meta.xml
force-app/main/default/classes/EnquiryDetailsWebServiceTest.cls
force-app/main/default/classes/EnquiryDetailsWebServiceTest.cls-meta.xml
force-app/main/default/classes/EquipmentCoverageTargetBatch.cls
force-app/main/default/classes/EquipmentCoverageTargetBatch.cls-meta.xml
force-app/main/default/classes/EquipmentCoverageTargetBatchTest.cls
force-app/main/default/classes/EquipmentCoverageTargetBatchTest.cls-meta.xml
force-app/main/default/classes/EquipmentRealCoverageRealBatch.cls
force-app/main/default/classes/EquipmentRealCoverageRealBatch.cls-meta.xml
force-app/main/default/classes/EquipmentRealCoverageRealBatchTest.cls
force-app/main/default/classes/EquipmentRealCoverageRealBatchTest.cls-meta.xml
force-app/main/default/classes/EquipmentRenewMoleculeBatch.cls
force-app/main/default/classes/EquipmentRenewMoleculeBatch.cls-meta.xml
force-app/main/default/classes/EquipmentRenewMoleculeBatchTest.cls
force-app/main/default/classes/EquipmentRenewMoleculeBatchTest.cls-meta.xml
force-app/main/default/classes/EquipmentRenewTargetBatch.cls
force-app/main/default/classes/EquipmentRenewTargetBatch.cls-meta.xml
force-app/main/default/classes/EquipmentRenewTargetBatchTest.cls
force-app/main/default/classes/EquipmentRenewTargetBatchTest.cls-meta.xml
force-app/main/default/classes/EquipmentRentalExtendController.cls
force-app/main/default/classes/EquipmentRentalExtendControllerTest.cls
force-app/main/default/classes/EquipmentRentalLostReportController.cls
force-app/main/default/classes/EquipmentRepairBatch.cls
force-app/main/default/classes/EquipmentRepairBatch.cls-meta.xml
force-app/main/default/classes/EquipmentRepairBatchTest.cls
force-app/main/default/classes/EquipmentRepairBatchTest.cls-meta.xml
force-app/main/default/classes/EquipmentSetShippmentReceived1Controller.cls
force-app/main/default/classes/EquipmentSetShippmentReceived2Controller.cls
force-app/main/default/classes/EquipmentSetShippmentReceived3Controller.cls
force-app/main/default/classes/EquipmentSetShippmentReceived5Controller.cls
force-app/main/default/classes/EventToEventDetailsSchedule.cls
force-app/main/default/classes/EventToEventDetailsScheduleTest.cls
force-app/main/default/classes/FilePreviewDownVFController.cls
force-app/main/default/classes/FilePreviewDownVFController.cls-meta.xml
force-app/main/default/classes/FilePreviewDownVFControllerTest.cls
force-app/main/default/classes/FilePreviewDownVFControllerTest.cls-meta.xml
force-app/main/default/classes/FileUploadController.cls
force-app/main/default/classes/FirstContractHistoricalBatch.cls
force-app/main/default/classes/FirstContractHistoricalBatch.cls-meta.xml
force-app/main/default/classes/FirstContractHistoricalBatchTest.cls
force-app/main/default/classes/FirstContractHistoricalBatchTest.cls-meta.xml
force-app/main/default/classes/HospitalApprovalResponseController.cls
force-app/main/default/classes/ImprovedForecastTimeController.cls
force-app/main/default/classes/ImprovedForecastTimeController.cls-meta.xml
force-app/main/default/classes/ImprovedForecastTimeControllerTest.cls
force-app/main/default/classes/ImprovedForecastTimeControllerTest.cls-meta.xml
force-app/main/default/classes/InquiryFormHandler.cls
force-app/main/default/classes/InquiryFormHandlerTest.cls
force-app/main/default/classes/InquiryPredictsDateChangeHandler.cls
force-app/main/default/classes/InquiryPredictsDateChangeHandler.cls-meta.xml
force-app/main/default/classes/InquiryPredictsDateChangeHandlerTest.cls
force-app/main/default/classes/InquiryPredictsDateChangeHandlerTest.cls-meta.xml
force-app/main/default/classes/InquiryVerifyBatch.cls
force-app/main/default/classes/InquiryVerifyBatchTest.cls
force-app/main/default/classes/InspectCheckController.cls
force-app/main/default/classes/InspectCheckControllerTest.cls
force-app/main/default/classes/InspectionReportTriggerHandler.cls
force-app/main/default/classes/InventoryController.cls
force-app/main/default/classes/InventoryControllerTest.cls
force-app/main/default/classes/InventoryStartAssetSnapshotCopyBatch.cls
force-app/main/default/classes/KPIPreviewScheduel.cls
force-app/main/default/classes/KPIPreviewScheduel.cls-meta.xml
force-app/main/default/classes/KPIPreviewScheduelTest.cls
force-app/main/default/classes/KPIPreviewScheduelTest.cls-meta.xml
force-app/main/default/classes/LastbuyProductHandler.cls
force-app/main/default/classes/LastbuyProductHandler.cls-meta.xml
force-app/main/default/classes/LastbuyProductHandlerTest.cls
force-app/main/default/classes/LastbuyProductHandlerTest.cls-meta.xml
force-app/main/default/classes/LeadTriggerTest.cls
force-app/main/default/classes/LightningUtil.cls
force-app/main/default/classes/LightningUtilTest.cls
force-app/main/default/classes/LogAutoSendBatch.cls
force-app/main/default/classes/LogAutoSendSchedule.cls
force-app/main/default/classes/LogAutoSendScheduleTest.cls
force-app/main/default/classes/LostCancelReportHandler.cls
force-app/main/default/classes/LostCancelReportHandlerTest.cls
force-app/main/default/classes/LostCancelReportOppBatch.cls
force-app/main/default/classes/LostCancelReportOppBatchTest.cls
force-app/main/default/classes/LostReportEditController.cls
force-app/main/default/classes/LostReportEditControllerTest.cls
force-app/main/default/classes/LostReportHandler.cls
force-app/main/default/classes/LostReportHandlerTest.cls
force-app/main/default/classes/MCAgentPDFControllerTest.cls
force-app/main/default/classes/MCHPDFControllerTest.cls
force-app/main/default/classes/MaintenanceCommissionPDFController.cls
force-app/main/default/classes/MaintenanceCommissionPDFController.cls-meta.xml
force-app/main/default/classes/MaintenanceCommissionPDFControllerTest.cls
force-app/main/default/classes/MaintenanceCommissionPDFControllerTest.cls-meta.xml
force-app/main/default/classes/MaintenanceContractAssetTriggerTester.cls
force-app/main/default/classes/MaintenanceContractNotOpenController.cls
force-app/main/default/classes/MaintenanceContractTriggerTest.cls-meta.xml
force-app/main/default/classes/MaintenanceContractVMPDFController.cls
force-app/main/default/classes/MaintenanceProductDataController.cls
force-app/main/default/classes/MaintenanceProductDataControllerTest.cls
force-app/main/default/classes/MaintenanceUpdateProductHandler.cls
force-app/main/default/classes/MceConfigPDFController.cls
force-app/main/default/classes/MeetingDelayApplyTriggerHandler.cls
force-app/main/default/classes/MergeAgencyActivityBatchTest.cls
force-app/main/default/classes/MergeObjectBatch.cls
force-app/main/default/classes/MergeObjectBatch.cls-meta.xml
force-app/main/default/classes/MergeObjectBatchTest.cls
force-app/main/default/classes/MergeObjectBatchTest.cls-meta.xml
force-app/main/default/classes/NFM001Controller.cls
force-app/main/default/classes/NFM001TriggerTest.cls
force-app/main/default/classes/NFM007Controller.cls
force-app/main/default/classes/NFM007TriggerTest.cls
force-app/main/default/classes/NFM010UpsertStatuAchievementsTriggerTest.cls
force-app/main/default/classes/NFM103Controller.cls
force-app/main/default/classes/NFM103ControllerTest.cls
force-app/main/default/classes/NFM104Rest.cls
force-app/main/default/classes/NFM105Rest.cls
force-app/main/default/classes/NFM105RestTest.cls
force-app/main/default/classes/NFM106Controller.cls
force-app/main/default/classes/NFM106ControllerTest.cls
force-app/main/default/classes/NFM115Controller.cls
force-app/main/default/classes/NFM116Batch.cls
force-app/main/default/classes/NFM117Rest.cls
force-app/main/default/classes/NFM117Rest.cls-meta.xml
force-app/main/default/classes/NFM117RestTest.cls
force-app/main/default/classes/NFM117RestTest.cls-meta.xml
force-app/main/default/classes/NFM201Controller.cls
force-app/main/default/classes/NFM202Controller.cls
force-app/main/default/classes/NFM203Rest.cls
force-app/main/default/classes/NFM206Rest.cls
force-app/main/default/classes/NFM206RestTest.cls
force-app/main/default/classes/NFM401Controller.cls
force-app/main/default/classes/NFM401ControllerTest.cls
force-app/main/default/classes/NFM501FutureController.cls
force-app/main/default/classes/NFM501TIDetailHistoryDataBatch.cls
force-app/main/default/classes/NFM501TIDetailHistoryDataBatch.cls-meta.xml
force-app/main/default/classes/NFM501TIDetailHistoryDataBatchTest.cls
force-app/main/default/classes/NFM501TIDetailHistoryDataBatchTest.cls-meta.xml
force-app/main/default/classes/NFM502Controller.cls
force-app/main/default/classes/NFM503InfoFileBatch.cls
force-app/main/default/classes/NFM504Controller.cls
force-app/main/default/classes/NFM601Controller.cls
force-app/main/default/classes/NFM601ControllerTest.cls
force-app/main/default/classes/NFM603Batch.cls
force-app/main/default/classes/NFM603Controller.cls
force-app/main/default/classes/NFM603ControllerTest.cls
force-app/main/default/classes/NFM606Controller.cls
force-app/main/default/classes/NFM606Controller.cls-meta.xml
force-app/main/default/classes/NFM606ControllerTest.cls
force-app/main/default/classes/NFM607Rest.cls
force-app/main/default/classes/NFM607RestTest.cls
force-app/main/default/classes/NFM608Rest.cls
force-app/main/default/classes/NFM609RestTest.cls
force-app/main/default/classes/NFM611Rest.cls
force-app/main/default/classes/NFM612Rest.cls
force-app/main/default/classes/NFM620Rest.cls
force-app/main/default/classes/NFM620RestTest.cls
force-app/main/default/classes/NFM621Controller.cls
force-app/main/default/classes/NFM624Batch.cls
force-app/main/default/classes/NFM624Batch.cls-meta.xml
force-app/main/default/classes/NFM624BatchSchedulable.cls
force-app/main/default/classes/NFM624BatchSchedulable.cls-meta.xml
force-app/main/default/classes/NFM624BatchSchedulableTest.cls
force-app/main/default/classes/NFM624BatchSchedulableTest.cls-meta.xml
force-app/main/default/classes/NFM624BatchTest.cls
force-app/main/default/classes/NFM624BatchTest.cls-meta.xml
force-app/main/default/classes/NFM624Rest.cls
force-app/main/default/classes/NFM624Rest2.cls
force-app/main/default/classes/NFM624Rest2.cls-meta.xml
force-app/main/default/classes/NFM624Rest2Test.cls
force-app/main/default/classes/NFM624Rest2Test.cls-meta.xml
force-app/main/default/classes/NFM624RestAbout.cls
force-app/main/default/classes/NFM624RestAboutTest.cls
force-app/main/default/classes/NFM624RestTest.cls
force-app/main/default/classes/NFM701Controller.cls
force-app/main/default/classes/NFM701ControllerHandler.cls
force-app/main/default/classes/NFM703Controller.cls
force-app/main/default/classes/NFM703ControllerTest.cls
force-app/main/default/classes/NFM703WebServiceTest.cls
force-app/main/default/classes/NFM704Rest.cls
force-app/main/default/classes/NFM704Rest.cls-meta.xml
force-app/main/default/classes/NFM704RestTest.cls
force-app/main/default/classes/NFM704RestTest.cls-meta.xml
force-app/main/default/classes/NFM705Rest.cls
force-app/main/default/classes/NFM705RestTest.cls
force-app/main/default/classes/NFMUtil.cls
force-app/main/default/classes/NewAccountExamineController.cls
force-app/main/default/classes/NewAccountExamineController.cls-meta.xml
force-app/main/default/classes/NewAccountExamineControllerTest.cls
force-app/main/default/classes/NewAccountExamineControllerTest.cls-meta.xml
force-app/main/default/classes/NewAgencyContactController.cls
force-app/main/default/classes/NewAgencyContactControllerTest.cls
force-app/main/default/classes/NewAgencyOpportunityController.cls
force-app/main/default/classes/NewAgencyOpportunityController.cls-meta.xml
force-app/main/default/classes/NewAgencyOpportunityControllerTest.cls
force-app/main/default/classes/NewAgencyOpportunityControllerTest.cls-meta.xml
force-app/main/default/classes/NewAndEditASEActivityController.cls
force-app/main/default/classes/NewAndEditAddressController.cls
force-app/main/default/classes/NewAndEditAddressControllerTest.cls
force-app/main/default/classes/NewAndEditAgencyOppoControllerTest.cls
force-app/main/default/classes/NewAndEditAgencyOppoControllerTest.cls-meta.xml
force-app/main/default/classes/NewAndEditAgencyOpportunityController.cls
force-app/main/default/classes/NewAndEditAgencyOpportunityController.cls-meta.xml
force-app/main/default/classes/NewAndEditBaseController.cls
force-app/main/default/classes/NewAndEditCaseController.cls
force-app/main/default/classes/NewAndEditCaseControllerTest.cls
force-app/main/default/classes/NewAndEditContactController.cls
force-app/main/default/classes/NewAndEditContactControllerTest.cls
force-app/main/default/classes/NewAndEditInquiryFormController.cls
force-app/main/default/classes/NewAndEditInspectionReportController.cls
force-app/main/default/classes/NewAndEditLeadController.cls
force-app/main/default/classes/NewAndEditLeadControllerTest.cls
force-app/main/default/classes/NewAndEditQISController.cls
force-app/main/default/classes/NewAndEditQISControllerTest.cls
force-app/main/default/classes/NewAndEditRepairSubOrderController.cls
force-app/main/default/classes/NewAndEditReportController.cls
force-app/main/default/classes/NewAndEditReportControllerTest.cls
force-app/main/default/classes/NewAndEditTenderinformationController.cls
force-app/main/default/classes/NewConsumApplyController.cls
force-app/main/default/classes/NewConsumApplyControllerTest.cls
force-app/main/default/classes/NewConsumApplyEquipSetDetailControlTest.cls
force-app/main/default/classes/NewConsumApplyEquipSetDetailController.cls
force-app/main/default/classes/NewMCAgentLimitPDFController.cls
force-app/main/default/classes/NewMCAgentLimitPDFController.cls-meta.xml
force-app/main/default/classes/NewMCAgentLimitPDFControllerTest.cls
force-app/main/default/classes/NewMCAgentLimitPDFControllerTest.cls-meta.xml
force-app/main/default/classes/NewMCAgentPDFController.cls
force-app/main/default/classes/NewMCHLimitPDFController.cls
force-app/main/default/classes/NewMCHLimitPDFControllerTest.cls
force-app/main/default/classes/NewMCHLimitPDFControllerTest.cls-meta.xml
force-app/main/default/classes/NewMCHPDFController.cls
force-app/main/default/classes/NewPaymentPlanLoadController.cls
force-app/main/default/classes/NewPaymentPlanLoadControllerTest.cls
force-app/main/default/classes/NewQuoteEntryController.cls
force-app/main/default/classes/NewQuoteEntryControllerTest.cls
force-app/main/default/classes/NewQuoteEntryWebService.cls
force-app/main/default/classes/NewQuoteIraiController.cls
force-app/main/default/classes/NewQuoteIraiController.cls-meta.xml
force-app/main/default/classes/NewQuoteIraiControllerTest.cls
force-app/main/default/classes/NewQuoteIraiControllerTest.cls-meta.xml
force-app/main/default/classes/NewRepairController.cls
force-app/main/default/classes/NewRepairControllerTest.cls
force-app/main/default/classes/NextMContractHistoricalBatch.cls
force-app/main/default/classes/NextMContractHistoricalBatch.cls-meta.xml
force-app/main/default/classes/NextMContractHistoricalBatchTest.cls
force-app/main/default/classes/NextMContractHistoricalBatchTest.cls-meta.xml
force-app/main/default/classes/OFSCalendarController.cls
force-app/main/default/classes/OFSCalendarControllerTest.cls
force-app/main/default/classes/OFSCalendarControllerTest.cls-meta.xml
force-app/main/default/classes/OFSInsReportLayoutController.cls
force-app/main/default/classes/OPDPlanCancelPostponePlanLogicBatch.cls
force-app/main/default/classes/OPDPlanCancelPostponePlanLogicBatchTest.cls
force-app/main/default/classes/OPDPlanHandler.cls
force-app/main/default/classes/OPDPlanHandlerTest.cls
force-app/main/default/classes/OPDPlanMarkBatchSchedule.cls
force-app/main/default/classes/OPDPlanMarkBatchScheduleTest.cls
force-app/main/default/classes/OPDSortManageController.cls
force-app/main/default/classes/OPDSortManageControllerTest.cls
force-app/main/default/classes/OdsToUserHandler.cls
force-app/main/default/classes/OnCallController.cls
force-app/main/default/classes/OnCallControllerTest.cls
force-app/main/default/classes/OpdAmountBatch.cls
force-app/main/default/classes/OpdAmountBatchTest.cls
force-app/main/default/classes/OppStrategyProductBatch.cls
force-app/main/default/classes/OppStrategyProductBatch.cls-meta.xml
force-app/main/default/classes/OppStrategyProductBatchTest.cls
force-app/main/default/classes/OppStrategyProductBatchTest.cls-meta.xml
force-app/main/default/classes/Opponent_Bid_InformationHandler.cls
force-app/main/default/classes/OpportunityAndContactDailyUpdateBatch.cls
force-app/main/default/classes/OpportunityAndContactDailyUpdateTest.cls
force-app/main/default/classes/OpportunityBefInsUpdTriggerTest.cls
force-app/main/default/classes/OpportunityHpDeptUpdTriggerTest.cls
force-app/main/default/classes/OpportunityLineItemTrigger.cls
force-app/main/default/classes/OpportunityLineItemTriggerTest.cls
force-app/main/default/classes/OpportunityPCLController2.cls
force-app/main/default/classes/OpportunityPCLController2Test.cls
force-app/main/default/classes/OpportunityServiceTest.cls
force-app/main/default/classes/OpportunityTrigger.cls
force-app/main/default/classes/OpportunityTriggerTest.cls
force-app/main/default/classes/OpportunityWebService.cls
force-app/main/default/classes/OpportunityWebServiceTest.cls
force-app/main/default/classes/Opportunity_Shipments_ForecastBatch.cls
force-app/main/default/classes/Opportunity_Shipments_ForecastBatchTest.cls
force-app/main/default/classes/OrdergoodsController.cls
force-app/main/default/classes/OrdergoodsControllerTest.cls
force-app/main/default/classes/PAEDecisionRecordController.cls
force-app/main/default/classes/PAEDecisionRecordControllerTest.cls
force-app/main/default/classes/PAEDecisionRecordTriggerTest.cls
force-app/main/default/classes/PCLLostProduct2AssetHandler.cls
force-app/main/default/classes/PCLLostProduct2AssetHandlerTest.cls
force-app/main/default/classes/PCLLostReportController.cls
force-app/main/default/classes/PIHelper.cls
force-app/main/default/classes/PaymentMaintenanceContractTriggerHTest.cls
force-app/main/default/classes/PaymentMaintenanceContractTriggerHTest.cls-meta.xml
force-app/main/default/classes/PaymentMaintenanceContractTriggerHandler.cls
force-app/main/default/classes/PaymentMaintenanceContractTriggerHandler.cls-meta.xml
force-app/main/default/classes/PaymentMaintenanceContractTriggerTest.cls-meta.xml
force-app/main/default/classes/PersonalCalendarController.cls
force-app/main/default/classes/PersonalCalendarControllerTest.cls
force-app/main/default/classes/PrintConsumblePDFController.cls
force-app/main/default/classes/PrintConsumblePDFControllertTest.cls
force-app/main/default/classes/Product2Handler.cls
force-app/main/default/classes/Product2HandlerTest.cls
force-app/main/default/classes/QISToETQWebServiceTest.cls
force-app/main/default/classes/QISTriggerTest.cls
force-app/main/default/classes/QuoteIraiHandler.cls
force-app/main/default/classes/QuoteIraiHandler.cls-meta.xml
force-app/main/default/classes/QuoteIraiHandlerTest.cls
force-app/main/default/classes/QuoteIraiHandlerTest.cls-meta.xml
force-app/main/default/classes/QuoteTrialController.cls
force-app/main/default/classes/ReceivingNoteWaitingReceiptController.cls
force-app/main/default/classes/RenewTargetToAsotBatch.cls
force-app/main/default/classes/RenewTargetToAsotBatch.cls-meta.xml
force-app/main/default/classes/RenewTargetToAsotBatchTest.cls
force-app/main/default/classes/RenewTargetToAsotBatchTest.cls-meta.xml
force-app/main/default/classes/RentalApplyBeforeUpdateTriggerTest.cls
force-app/main/default/classes/RentalApplyController.cls
force-app/main/default/classes/RentalApplyControllerTest.cls
force-app/main/default/classes/RentalApplyEquipmentSetDetailHandler.cls
force-app/main/default/classes/RentalApplyEquipmentSetDetailHandlerTest.cls
force-app/main/default/classes/RentalApplyEquipmentSetHandler.cls
force-app/main/default/classes/RentalApplyEquipmentSetHandlerTest.cls
force-app/main/default/classes/RentalApplyFinalReplyDayBatch.cls
force-app/main/default/classes/RentalApplyFinalReplyDayBatch.cls-meta.xml
force-app/main/default/classes/RentalApplyFinalReplyDayBatchTest.cls
force-app/main/default/classes/RentalApplyFinalReplyDayBatchTest.cls-meta.xml
force-app/main/default/classes/RentalApplyFinalReplyDaySchedule.cls
force-app/main/default/classes/RentalApplyFinalReplyDaySchedule.cls-meta.xml
force-app/main/default/classes/RentalApplyShareHandler.cls
force-app/main/default/classes/RentalApplyShareHandlerTest.cls
force-app/main/default/classes/RentalApplySplitController.cls
force-app/main/default/classes/RentalApplyTriggerHandler.cls
force-app/main/default/classes/RentalApplyTriggerHandlerTest.cls
force-app/main/default/classes/RentalApplyTriggerTest.cls
force-app/main/default/classes/RentalApplyWebService.cls
force-app/main/default/classes/RentalApplyWebServiceTest.cls
force-app/main/default/classes/RentalFixtureManage12Test.cls
force-app/main/default/classes/RentalFixtureManage5Test.cls
force-app/main/default/classes/RentalFixtureSetAssignAgencyController.cls
force-app/main/default/classes/RentalFixtureSetAssignController.cls
force-app/main/default/classes/RentalFixtureSetAssignControllerTest.cls
force-app/main/default/classes/RentalHpDeptUpdTriggerTest.cls
force-app/main/default/classes/RentalReportExportController.cls
force-app/main/default/classes/RentalReportExportController.cls-meta.xml
force-app/main/default/classes/RentalReportExportControllerTest.cls
force-app/main/default/classes/RentalReportExportControllerTest.cls-meta.xml
force-app/main/default/classes/RepPAEDecisionRecordController.cls
force-app/main/default/classes/RepPAEDecisionRecordController.cls-meta.xml
force-app/main/default/classes/RepPAEDecisionRecordControllerTest.cls
force-app/main/default/classes/RepPAEDecisionRecordControllerTest.cls-meta.xml
force-app/main/default/classes/RepairBeforeInsertHandler.cls
force-app/main/default/classes/RepairBeforeInsertHandlerTest.cls
force-app/main/default/classes/RepairQuoteTrigger.cls
force-app/main/default/classes/RepairQuoteTriggerTest.cls
force-app/main/default/classes/RepairResonCannotWarrantyHistoricalBatch.cls
force-app/main/default/classes/RepairResonCannotWarrantyHistoricalBatch.cls-meta.xml
force-app/main/default/classes/RepairResonHistoricalBatchTest.cls
force-app/main/default/classes/RepairResonHistoricalBatchTest.cls-meta.xml
force-app/main/default/classes/RepairTrigger.cls
force-app/main/default/classes/RepairTriggerTester.cls
force-app/main/default/classes/RetrospectiveWeeklyReportController.cls
force-app/main/default/classes/RetrospectiveWeeklyReportController.cls-meta.xml
force-app/main/default/classes/RetrospectiveWeeklyReportControllerTest.cls
force-app/main/default/classes/RetrospectiveWeeklyReportControllerTest.cls-meta.xml
force-app/main/default/classes/RollupToHPBatch.cls
force-app/main/default/classes/RollupToHPBatchTest.cls
force-app/main/default/classes/RollupToMaintenanceContractBatch.cls
force-app/main/default/classes/RollupToMaintenanceContractSchedule.cls
force-app/main/default/classes/RollupToMaintenanceContractScheduleTest.cls
force-app/main/default/classes/SI_NewQuoteEntryController.cls
force-app/main/default/classes/SI_NewQuoteEntryControllerTest.cls
force-app/main/default/classes/SSBackorderBatch.cls
force-app/main/default/classes/SSOpportunityBatch.cls
force-app/main/default/classes/SearchContactController.cls
force-app/main/default/classes/SearchContactControllerTest.cls
force-app/main/default/classes/SearchProductController.cls
force-app/main/default/classes/SelectAssetEstimateController.cls
force-app/main/default/classes/SelectAssetEstimateControllerTest.cls
force-app/main/default/classes/SelectAssetEstimateURFController.cls
force-app/main/default/classes/SelectAssetEstimateURFControllerTest.cls
force-app/main/default/classes/SelectAssetEstimateVMController.cls
force-app/main/default/classes/SelectAssetEstimateVMControllerTest.cls
force-app/main/default/classes/SelectAssetExtension.cls
force-app/main/default/classes/SelectAssetExtensionTester.cls
force-app/main/default/classes/SetOlympusCalendarWorkDayBatch.cls
force-app/main/default/classes/SetPersonalTargetController.cls
force-app/main/default/classes/SetPersonalTargetControllerTest.cls
force-app/main/default/classes/SetProvinceTargetBatch.cls
force-app/main/default/classes/SetProvinceTargetBatch.cls-meta.xml
force-app/main/default/classes/SetProvinceTargetBatchTest.cls
force-app/main/default/classes/SetProvinceTargetBatchTest.cls-meta.xml
force-app/main/default/classes/SetProvinceTargetController.cls
force-app/main/default/classes/SetProvinceTargetControllerTest.cls
force-app/main/default/classes/SimpleEventRegisterController.cls
force-app/main/default/classes/SpareIsLoanBatch.cls
force-app/main/default/classes/SpareIsLoanBatchSchedule.cls
force-app/main/default/classes/SpareIsLoanBatchScheduleTesT.cls
force-app/main/default/classes/SpareIsLoanBatchTest.cls
force-app/main/default/classes/StandardFieldDefaultsController.cls
force-app/main/default/classes/StandardFieldDefaultsController.cls-meta.xml
force-app/main/default/classes/StandardFieldDefaultsControllerTest.cls
force-app/main/default/classes/StandardFieldDefaultsControllerTest.cls-meta.xml
force-app/main/default/classes/StartTradingController.cls
force-app/main/default/classes/StartTradingControllerTest.cls
force-app/main/default/classes/StaticParameter.cls
force-app/main/default/classes/StatuAchievementsPCLController.cls
force-app/main/default/classes/StatusPageController.cls
force-app/main/default/classes/StatusPageControllerTest.cls
force-app/main/default/classes/StraightBackAddressController.cls
force-app/main/default/classes/SubmitForApprovalController.cls
force-app/main/default/classes/SumAnnualRepairAmountBatch.cls
force-app/main/default/classes/SumAnnualRepairAmountBatch.cls-meta.xml
force-app/main/default/classes/SumEquipmentInventoryBatch.cls
force-app/main/default/classes/SumEquipmentInventoryBatch.cls-meta.xml
force-app/main/default/classes/SummaryHospitalTest.cls
force-app/main/default/classes/SummaryHospitalTest.cls-meta.xml
force-app/main/default/classes/SummaryThreeYearsContractBatch.cls
force-app/main/default/classes/SummaryThreeYearsContractBatch.cls-meta.xml
force-app/main/default/classes/SyncAccountContactToAWS.cls
force-app/main/default/classes/SyncAccountContactToAWS.cls-meta.xml
force-app/main/default/classes/SyncAccountContactToAWSTest.cls
force-app/main/default/classes/SyncAccountContactToAWSTest.cls-meta.xml
force-app/main/default/classes/SyncOpportunityTest.cls
force-app/main/default/classes/TaskObjectTriggerHandle.cls
force-app/main/default/classes/TaskStatusUpdateBatch.cls
force-app/main/default/classes/TenderDeleteControllerTest.cls
force-app/main/default/classes/TenderDeleteLwcController.cls
force-app/main/default/classes/TenderDeleteLwcController.cls-meta.xml
force-app/main/default/classes/TenderDeleteLwcControllerTest.cls
force-app/main/default/classes/TenderDeleteLwcControllerTest.cls-meta.xml
force-app/main/default/classes/TenderInformationHandler.cls
force-app/main/default/classes/TenderInformationHandlerTest.cls
force-app/main/default/classes/TenderLostController.cls
force-app/main/default/classes/TenderLostController.cls-meta.xml
force-app/main/default/classes/TenderLostControllerTest.cls
force-app/main/default/classes/TenderLostControllerTest.cls-meta.xml
force-app/main/default/classes/TenderManageController.cls
force-app/main/default/classes/TenderManageControllerTest.cls
force-app/main/default/classes/TenderOpportunityLinkHandler.cls
force-app/main/default/classes/TenderOpportunityLinkHandlerTest.cls
force-app/main/default/classes/TenderResultConfirmTaskBatch.cls
force-app/main/default/classes/TenderResultConfirmTaskBatch.cls-meta.xml
force-app/main/default/classes/TenderResultConfirmTaskBatchTest.cls
force-app/main/default/classes/TenderResultConfirmTaskBatchTest.cls-meta.xml
force-app/main/default/classes/TestDataUtility.cls
force-app/main/default/classes/TestDataUtility.cls-meta.xml
force-app/main/default/classes/TransferApplyHandler.cls
force-app/main/default/classes/TransferApplySelectDetailController.cls
force-app/main/default/classes/TransferApplySelectDetailSubController.cls
force-app/main/default/classes/TransferShippmentReceived2Controller.cls
force-app/main/default/classes/TransferShippmentReceived2ControllerTest.cls
force-app/main/default/classes/TransferShippmentReceived5Controller.cls
force-app/main/default/classes/TransferShippmentReceived5ControllerTest.cls
force-app/main/default/classes/UpdAccountExamineController.cls
force-app/main/default/classes/UpdAccountExamineController.cls-meta.xml
force-app/main/default/classes/UpdAccountExamineControllerTest.cls
force-app/main/default/classes/UpdAccountExamineControllerTest.cls-meta.xml
force-app/main/default/classes/UpdateActivatedDateContactBatch.cls
force-app/main/default/classes/UpdateActivatedDateContactBatch.cls-meta.xml
force-app/main/default/classes/UpdateActivatedDateContactBatchTest.cls
force-app/main/default/classes/UpdateActivatedDateContactBatchTest.cls-meta.xml
force-app/main/default/classes/UpdateAssetReturnTimeSchedule.cls
force-app/main/default/classes/UpdateAssetToCurrentMCBatch.cls
force-app/main/default/classes/UpdateContractAimAmountHandler.cls
force-app/main/default/classes/UpdateContractAimAmountHandlerTest.cls
force-app/main/default/classes/UpdateHospitalOppDateBatch.cls
force-app/main/default/classes/UpdateInquiryFormConfirmationBatch.cls
force-app/main/default/classes/UpdateInquiryFormConfirmationBatchTest.cls
force-app/main/default/classes/UpdateInquiryFormConfirmationBatchTest.cls-meta.xml
force-app/main/default/classes/UpdateInspectionReportAssetBatch.cls
force-app/main/default/classes/UpdateRentalApplyBatch.cls
force-app/main/default/classes/UpdateRentalApplyEquipmentSetBatch.cls
force-app/main/default/classes/UpdateRentalApplyEquipmentSetBatchTest.cls
force-app/main/default/classes/UpdateTenderInformation01Batch.cls
force-app/main/default/classes/UpdateTenderInformation01Batch.cls-meta.xml
force-app/main/default/classes/UpdateTenderInformation01BatchTest.cls
force-app/main/default/classes/UpdateTenderInformation01BatchTest.cls-meta.xml
force-app/main/default/classes/UpdateTenderInformation01Schedulable.cls
force-app/main/default/classes/UpdateTenderInformation01Schedulable.cls-meta.xml
force-app/main/default/classes/UpdateTenderInformation01SchedulableTest.cls
force-app/main/default/classes/UpdateTenderInformation01SchedulableTest.cls-meta.xml
force-app/main/default/classes/UpdateTenderInformationBatch.cls
force-app/main/default/classes/UpdateTenderInformationBatch2.cls
force-app/main/default/classes/UpdateTenderInformationBatch2.cls-meta.xml
force-app/main/default/classes/UpdateTenderInformationBatch2Test.cls
force-app/main/default/classes/UpdateTenderInformationBatch2Test.cls-meta.xml
force-app/main/default/classes/UpdateTenderInformationBatchTest.cls
force-app/main/default/classes/UpdateURFContactBatch.cls
force-app/main/default/classes/UpdateYearlyContactSchedule.cls
force-app/main/default/classes/UpdateYearlyContactSchedule.cls-meta.xml
force-app/main/default/classes/UpdateYearlyContactScheduleTest.cls
force-app/main/default/classes/UpdateYearlyContactScheduleTest.cls-meta.xml
force-app/main/default/classes/UploadOBPMController.cls
force-app/main/default/classes/UserProfileHandler.cls
force-app/main/default/classes/UserToContactTriggerTest.cls
force-app/main/default/classes/ViewParticipantsController.cls
force-app/main/default/classes/ViewParticipantsControllerTest.cls
force-app/main/default/classes/WeeklyReportCmp.cls
force-app/main/default/classes/WeeklyReportCmpTest.cls
force-app/main/default/classes/XinDailyReportController.cls
force-app/main/default/classes/XinDailyReportControllerTest.cls
force-app/main/default/classes/createEmptyDailyReportSchedule.cls
force-app/main/default/classes/createEmptyDailyReportScheduleTest.cls
force-app/main/default/classes/rentalApplyToShipmentWorkTimeHDBatch.cls
force-app/main/default/classes/rentalApplyToShipmentWorkTimeHDBatch.cls-meta.xml
force-app/main/default/classes/rollupToRepairBatch.cls
force-app/main/default/classes/rollupToRepairBatchTest.cls
force-app/main/default/classes/taskAlertController.cls
force-app/main/default/classes/updateFirstServiceContractWebService.cls
force-app/main/default/classes/updateFirstServiceContractWebService.cls-meta.xml
force-app/main/default/classes/updateFirstServiceContractWebServiceTest.cls
force-app/main/default/classes/updateFirstServiceContractWebServiceTest.cls-meta.xml
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.html
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js
force-app/main/default/lwc/improvedForecastTime/improvedForecastTime.js-meta.xml
force-app/main/default/lwc/maintenanceContractNotOpen/maintenanceContractNotOpen.html
force-app/main/default/lwc/maintenanceContractNotOpen/maintenanceContractNotOpen.js
force-app/main/default/lwc/quoteTrial/quoteTrial.html
force-app/main/default/lwc/quoteTrial/quoteTrial.js
force-app/main/default/lwc/quoteTrial/quoteTrialUtil.js
force-app/main/default/lwc/relevant/relevant.html
force-app/main/default/lwc/relevant/relevant.js
force-app/main/default/lwc/tBidding/tBidding.html
force-app/main/default/lwc/tBidding/tBidding.js
force-app/main/default/lwc/tenderDeletePage/tenderDeletePage.html
force-app/main/default/lwc/tenderDeletePage/tenderDeletePage.js
force-app/main/default/lwc/tenderDeletePage/tenderDeletePage.js-meta.xml
force-app/main/default/lwc/tenderLost/tenderLost.html
force-app/main/default/lwc/tenderLost/tenderLost.js
force-app/main/default/lwc/tenderLost/tenderLost.js-meta.xml
force-app/main/default/pages/AccChangeApprovalResponse.page
force-app/main/default/pages/AccChangeApprovalResponse.page-meta.xml
force-app/main/default/pages/AccChangeApprovalResponsePopUp.page
force-app/main/default/pages/AccChangeApprovalResponsePopUp.page-meta.xml
force-app/main/default/pages/AccountTargetTab.page
force-app/main/default/pages/AdvanceOpportunity.page
force-app/main/default/pages/AdvanceOpportunity.page-meta.xml
force-app/main/default/pages/AssessmentReport.page
force-app/main/default/pages/AssetModifyBelongs.page
force-app/main/default/pages/AssetQR.page
force-app/main/default/pages/AttachmentPreview.page
force-app/main/default/pages/BMEWorkPage.page
force-app/main/default/pages/B_Test.page
force-app/main/default/pages/BatchSelectRepairPage.page
force-app/main/default/pages/BatchSelectRepairPage.page-meta.xml
force-app/main/default/pages/CM_SearchContact.page
force-app/main/default/pages/CM_SearchContactService.page
force-app/main/default/pages/ChangeDealerApproval.page
force-app/main/default/pages/ChoiceAsset.page
force-app/main/default/pages/ConsumApplyBR.page
force-app/main/default/pages/ConsumApplyQR.page
force-app/main/default/pages/ConsumEquipmentSetReceived.page
force-app/main/default/pages/ConsumEquipmentSetReturn.page
force-app/main/default/pages/ConsumEquipmentSetShipment.page
force-app/main/default/pages/ConsumReassign.page
force-app/main/default/pages/ConsumTrial.page
force-app/main/default/pages/ConsumTrialPDF.page
force-app/main/default/pages/ConsumTrialUpdate.page
force-app/main/default/pages/ContractDetailPDF.page
force-app/main/default/pages/Create_Opportunity_by_Agency_Opportunity.page
force-app/main/default/pages/CustomDeleteVF.page
force-app/main/default/pages/DealerPersonnelInformationImport.page
force-app/main/default/pages/DealerPersonnelInformationImport.page-meta.xml
force-app/main/default/pages/DiscountProductApplication.page
force-app/main/default/pages/EnquiryDetails.page
force-app/main/default/pages/EquipmentRentalExtend.page
force-app/main/default/pages/EquipmentSetShippmentReceived2.page
force-app/main/default/pages/EquipmentSetShippmentReceived5.page
force-app/main/default/pages/FilePreviewDownVF.page
force-app/main/default/pages/FilePreviewDownVF.page-meta.xml
force-app/main/default/pages/FixtureRentalPDF.page
force-app/main/default/pages/FollowPage.page
force-app/main/default/pages/FollowPage.page-meta.xml
force-app/main/default/pages/GSurveys.page
force-app/main/default/pages/HospitalApprovalResponse.page
force-app/main/default/pages/HospitalApprovalResponsePopUp.page
force-app/main/default/pages/ImprovedForecastTime.page
force-app/main/default/pages/ImprovedForecastTime.page-meta.xml
force-app/main/default/pages/ImprovedForecastTimeAno.page
force-app/main/default/pages/ImprovedForecastTimeAno.page-meta.xml
force-app/main/default/pages/InsReportPDF.page
force-app/main/default/pages/InstructReport.page
force-app/main/default/pages/InventoryList.page
force-app/main/default/pages/InventoryResultRecord.page
force-app/main/default/pages/InventoryResultRecordCopy.page
force-app/main/default/pages/LastbuyProductNew.page
force-app/main/default/pages/LastbuyProductNew.page-meta.xml
force-app/main/default/pages/LostEditPage1.page
force-app/main/default/pages/LostReportEdit.page
force-app/main/default/pages/LostReportEditAsset.page
force-app/main/default/pages/LostViewPage1.page
force-app/main/default/pages/MaintenanceCommissionPDF.page
force-app/main/default/pages/MaintenanceCommissionPDF.page-meta.xml
force-app/main/default/pages/MaintenanceContractEstimateVMPDF.page
force-app/main/default/pages/MaintenanceProductData.page
force-app/main/default/pages/MaxManagmentCode.page
force-app/main/default/pages/MaxManagmentCodeTransfer.page
force-app/main/default/pages/NewAccount.page
force-app/main/default/pages/NewAccount.page-meta.xml
force-app/main/default/pages/NewAccountExamine.page
force-app/main/default/pages/NewAccountExamine.page-meta.xml
force-app/main/default/pages/NewAndEditASEActivity.page
force-app/main/default/pages/NewAndEditAddress.page
force-app/main/default/pages/NewAndEditAgencyContact.page
force-app/main/default/pages/NewAndEditCampaignMember.page
force-app/main/default/pages/NewAndEditCase.page
force-app/main/default/pages/NewAndEditContact.page
force-app/main/default/pages/NewAndEditContact.page-meta.xml
force-app/main/default/pages/NewAndEditInquiryForm.page
force-app/main/default/pages/NewAndEditInspectionReport.page
force-app/main/default/pages/NewAndEditLead.page
force-app/main/default/pages/NewAndEditQIS.page
force-app/main/default/pages/NewAndEditRepairSubOrder.page
force-app/main/default/pages/NewAndEditReport.page
force-app/main/default/pages/NewAndEditTenderinformation.page
force-app/main/default/pages/NewConsumApply.page
force-app/main/default/pages/NewConsumApplyEquipmentSetDetail.page
force-app/main/default/pages/NewMCAgentPDF.page
force-app/main/default/pages/NewMCAgentPDFLimit.page
force-app/main/default/pages/NewMCAgentPDFLimit.page-meta.xml
force-app/main/default/pages/NewMCHPDF.page
force-app/main/default/pages/NewMCHPDFLimit.page
force-app/main/default/pages/NewOnCall.page
force-app/main/default/pages/NewPaymentPlanLoad.page
force-app/main/default/pages/NewQuoteEntry.page
force-app/main/default/pages/NewQuoteIrai.page
force-app/main/default/pages/NewRentalApply.page
force-app/main/default/pages/NewRepair.page
force-app/main/default/pages/NotReceivingNoteWaitingReceipt.page
force-app/main/default/pages/OFSInsReportLayout.page
force-app/main/default/pages/OPDSortManage.page
force-app/main/default/pages/OpportunityPCLNew.page
force-app/main/default/pages/Ordergoods.page
force-app/main/default/pages/PersonalEvaluation2.page
force-app/main/default/pages/ProductSetRollup.page
force-app/main/default/pages/QISPDF.page
force-app/main/default/pages/QLMAttachmentPreview.page
force-app/main/default/pages/QLMAttachmentPreview1.page
force-app/main/default/pages/ReantalApplySeriesNo.page
force-app/main/default/pages/ReceivingNoteQR.page
force-app/main/default/pages/ReceivingNoteWaitingReceipt.page
force-app/main/default/pages/RentalApplyBR.page
force-app/main/default/pages/RentalApplyQR.page
force-app/main/default/pages/RentalApplySequence.page
force-app/main/default/pages/RentalReportExport.page
force-app/main/default/pages/RentalReportExport.page-meta.xml
force-app/main/default/pages/RentalSequenceWatch.page
force-app/main/default/pages/RepPAEDecisionRecord.page
force-app/main/default/pages/RepPAEDecisionRecord.page-meta.xml
force-app/main/default/pages/ReportExport.page
force-app/main/default/pages/ReportExport.page-meta.xml
force-app/main/default/pages/RetrospectiveWeeklyReportPage.page
force-app/main/default/pages/RetrospectiveWeeklyReportPage.page-meta.xml
force-app/main/default/pages/SI_NewQuoteEntry.page
force-app/main/default/pages/SLAReportDetails.page
force-app/main/default/pages/SearchContactPage.page
force-app/main/default/pages/SearchContract.page
force-app/main/default/pages/SearchProduct.page
force-app/main/default/pages/SearchProductIrai.page
force-app/main/default/pages/SearchVisitor.page
force-app/main/default/pages/SelectAssetEstimate.page
force-app/main/default/pages/SelectAssetEstimateURF.page
force-app/main/default/pages/SelectAssetEstimateVM.page
force-app/main/default/pages/ServiceFollowPage.page
force-app/main/default/pages/ServiceMaintenanceTaskPage.page
force-app/main/default/pages/SetPersonalTarget.page
force-app/main/default/pages/SetPersonalTargetcsv.page
force-app/main/default/pages/SetProvinceTarget.page
force-app/main/default/pages/SetProvinceTargetcsv.page
force-app/main/default/pages/SimpleEventRegister.page
force-app/main/default/pages/SpecialPrice.page
force-app/main/default/pages/StandardFieldDefaults.page
force-app/main/default/pages/StandardFieldDefaults.page-meta.xml
force-app/main/default/pages/StartTrading.page
force-app/main/default/pages/StatuAchievementsPCL.page
force-app/main/default/pages/StatusPage.page
force-app/main/default/pages/StraightBackAddress.page
force-app/main/default/pages/SubmitForApprovalPage.page
force-app/main/default/pages/SurveyPage.page
force-app/main/default/pages/TenderAttachment.page
force-app/main/default/pages/TenderDeletePagelwc.page
force-app/main/default/pages/TenderDeletePagelwc.page-meta.xml
force-app/main/default/pages/TenderInformationUploadPdf.page
force-app/main/default/pages/TenderLostPage.page
force-app/main/default/pages/TenderLostPage.page-meta.xml
force-app/main/default/pages/TransferApplyQR.page
force-app/main/default/pages/TransferShippmentReceived2.page
force-app/main/default/pages/TransferShippmentReceived5.page
force-app/main/default/pages/UpdAccount.page
force-app/main/default/pages/UpdAccount.page-meta.xml
force-app/main/default/pages/UpdAccountExamine.page
force-app/main/default/pages/UpdAccountExamine.page-meta.xml
force-app/main/default/pages/ViewAddressDecryptInfo.page
force-app/main/default/pages/ViewAgencyOpportunityDecryptInfo.page
force-app/main/default/pages/ViewAgencyOpportunityDecryptInfo.page-meta.xml
force-app/main/default/pages/ViewConsumApplyEquipmentSetDetailDecrypt.page
force-app/main/default/pages/ViewLeadDecryptInfo.page
force-app/main/default/pages/ViewOnCallDecrypt.page
force-app/main/default/pages/ViewParticipantsDecryptInfo.page
force-app/main/default/pages/ViewRepairEncrypt.page
force-app/main/default/pages/ViewTenderinformationDecryptInfo.page
force-app/main/default/pages/WebToEquipmentSetShippmentReceived.page
force-app/main/default/pages/XinDailyReport.page
force-app/main/default/pages/eSignFormAttachment.page
force-app/main/default/pages/eSignFormQR.page
force-app/main/default/pages/searchAimsAccount.page
force-app/main/default/pages/taskAlert.page
force-app/main/default/staticresources/AWSService/AWSService.js
force-app/main/default/staticresources/NewQuoteEntryJS.js
force-app/main/default/staticresources/NewQuoteEntryJS.resource-meta.xml
force-app/main/default/staticresources/NewQuoteIraiJS.js
force-app/main/default/staticresources/XinDailyReportTuning2Js.js
force-app/main/default/staticresources/html2canvas.js
force-app/main/default/staticresources/html2canvas.resource-meta.xml
force-app/main/default/staticresources/instascan.js
force-app/main/default/staticresources/jspdf.js
force-app/main/default/staticresources/jspdf.resource-meta.xml
force-app/main/default/staticresources/xlsxCoreMinJs.js
force-app/main/default/staticresources/xlsxCoreMinJs.resource-meta.xml
force-app/main/default/triggers/AccountDelayApplyTrigger.trigger
force-app/main/default/triggers/AccountDelayApplyTrigger.trigger-meta.xml
force-app/main/default/triggers/AccountTrigger.trigger
force-app/main/default/triggers/AfterUpdateReport.trigger
force-app/main/default/triggers/AgencyContactTrigger.trigger
force-app/main/default/triggers/AgencyOppUpd.trigger
force-app/main/default/triggers/AssetTrigger.trigger
force-app/main/default/triggers/AttachmentTrigger.trigger
force-app/main/default/triggers/BringQuantityTrigger.trigger
force-app/main/default/triggers/BringQuantityTrigger.trigger-meta.xml
force-app/main/default/triggers/CampaignMemberTrigger.trigger
force-app/main/default/triggers/CaseHpDeptUpd.trigger
force-app/main/default/triggers/ChangedDepartmentOwner.trigger
force-app/main/default/triggers/CheckInspectionSubmitUser.trigger
force-app/main/default/triggers/ConLostReportTrigger.trigger
force-app/main/default/triggers/ConLostReportTrigger.trigger-meta.xml
force-app/main/default/triggers/ConsumApplyEquipmentSetDetailTrigger.trigger
force-app/main/default/triggers/ConsumApplyTrigger.trigger
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
force-app/main/default/triggers/ConsumableOrderTrigger.trigger
force-app/main/default/triggers/ContactHpDeptUpd.trigger
force-app/main/default/triggers/ContactToUser.trigger
force-app/main/default/triggers/ContactTrigger.trigger
force-app/main/default/triggers/FollowTrigger.trigger
force-app/main/default/triggers/InquiryForm.trigger
force-app/main/default/triggers/InquiryPredictsDateChangeTriggers.trigger
force-app/main/default/triggers/InquiryPredictsDateChangeTriggers.trigger-meta.xml
force-app/main/default/triggers/InspectionReportTrigger.trigger
force-app/main/default/triggers/LastbuyProductTrigger.trigger
force-app/main/default/triggers/LastbuyProductTrigger.trigger-meta.xml
force-app/main/default/triggers/LeadTrigger.trigger
force-app/main/default/triggers/LostCancelReportTrigger.trigger
force-app/main/default/triggers/MaintenanceContractAssetTrigger.trigger
force-app/main/default/triggers/MakeAssetHistory.trigger
force-app/main/default/triggers/NFM001.trigger
force-app/main/default/triggers/NFM007.trigger
force-app/main/default/triggers/NFM010UpsertStatuAchievements.trigger
force-app/main/default/triggers/NFM202Opp.trigger
force-app/main/default/triggers/NFM207.trigger
force-app/main/default/triggers/OdsTrigger.trigger
force-app/main/default/triggers/OnCallTrigger.trigger
force-app/main/default/triggers/Opponent_Bid_InformationTrigger.trigger
force-app/main/default/triggers/OpportunityBefUpd.trigger
force-app/main/default/triggers/OpportunityHpDeptUpd.trigger
force-app/main/default/triggers/OpportunityTrigger.trigger
force-app/main/default/triggers/PAEDecisionRecordTrigger.trigger
force-app/main/default/triggers/PaymentMaintenanceContractTrigger.trigger-meta.xml
force-app/main/default/triggers/QISTrigger.trigger
force-app/main/default/triggers/QuoteIraiTrigger.trigger
force-app/main/default/triggers/QuoteIraiTrigger.trigger-meta.xml
force-app/main/default/triggers/RentalApplyBeforeUpdate.trigger
force-app/main/default/triggers/RentalApplyOtherTrigger.trigger
force-app/main/default/triggers/RentalApplyShare.trigger
force-app/main/default/triggers/RentalApplyTrigger.trigger
force-app/main/default/triggers/RentalHpDeptUpd.trigger
force-app/main/default/triggers/RepairHpDeptUpd.trigger
force-app/main/default/triggers/RepairOrder.trigger-meta.xml
force-app/main/default/triggers/RepairQuoteTrigger.trigger
force-app/main/default/triggers/ReportCPileUp.trigger
force-app/main/default/triggers/ReportHpDeptUpd.trigger
force-app/main/default/triggers/ReportTrigger.trigger
force-app/main/default/triggers/Report_BeforeFieldCopy.trigger
force-app/main/default/triggers/SolutionProjectRequirementsTrigger.trigger
force-app/main/default/triggers/SyncMBOpportunity.trigger
force-app/main/default/triggers/SyncOpportunity.trigger
force-app/main/default/triggers/SyncRepairFromMCAETrigger.trigger
force-app/main/default/triggers/TenderInformationTrigger.trigger
force-app/main/default/triggers/TenderOpportunityLinkTrigger.trigger
force-app/main/default/triggers/UserToContact.trigger
force-app/main/default/triggers/taskObjectTrigger.trigger |